|
| [WD] Convert JPEG image quality (and size) |
| Iniciado por guest, 02,ago. 2017 21:30 - 1 respuesta |
| |
| | | |
|
| |
| Publicado el 02,agosto 2017 - 21:30 |
Hello
Starting from an example published on: http://windevapi.free.fr/forum1.php…
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.
Please, can someone tell me where is the problem??
Thanks in advance
Gianni |
| |
| |
| | | |
|
| | |
| |
| Publicado el 03,agosto 2017 - 13:36 |
Hi Gianni,
I don't know about this example at all, and I don't care to learn, as you can achieve what you want in about 2 lines of wlanguage:
1. Load the image to modify into an image field whose size (..X, ..Y) is your TARGET size 2. Save the image with dsaveImageJPG (it will be at the new size, and with the new resolution that you set in your dsaveimageJPG options)
Done!
Best regards |
| |
| |
| | | |
|
| | | | |
| | |
|