Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

[WD] Convert JPEG image quality (and size)

$
0
0
Hello

Starting from an example published on:
[windevapi.free.fr]


I'm trying to reduce the size of images loaded and saved on a longblob field in a table of a MySql database.

This is the portion of code :
PROCEDURE ReduceSize(InFileName, OutFileName, Quality)
wiaFormatJPEG       is string ="B96B3CAE-0728-11D3-9D7B-0000F81EF32E}"


oFichierImage is object Automation dynamic 
oProcessImage is object Automation dynamic 

oFichierImage = new object Automation "WIA.ImageFile" 
oProcessImage = new object Automation "WIA.ImageProcess" 

oFichierImage>>LoadFile(InFileName) 


oProcessImage>>Filters>>Add(oProcessImage>>FilterInfos("Convert")>>FilterID) 
oProcessImage>>Filters(1)>>Properties("FormatID")>>Value = wiaFormatJPEG <<<< The problem is here
oProcessImage>>Filters(1)>>Properties("Quality")>>Value = Quality

oFichierImage = oProcessImage>>Apply(oFichierImage) 
oFichierImage>>SaveFile(OutFileName)

This is the error code i see when the routine is executed:

Error at line 29 of Local Procedure ReduceSize process.
Access to Value Automation member.
Erreur 80210065 : Formato dell'ID non valido.
Erreur 80210065 : Formato dell'ID non valido.

For your info i'm working on a Windows 10 pc..

Please, can someone tell me where is the problem??

Thanks in advance

Gianni

Viewing all articles
Browse latest Browse all 1914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>