[Gambas-user] Image.Save method How to specify the DPI?

Benoît Minisini g4mba5 at gmail.com
Mon Feb 21 14:34:05 CET 2022


Le 21/02/2022 à 14:21, Bruce Steers a écrit :
> 
> 
> On Mon, 21 Feb 2022, 09:57 Martin Belmonte, <mbelmonte at belmotek.net 
> <mailto:mbelmonte at belmotek.net>> wrote:
> 
>     Hi,
>     When save method is called it require 2 arguments the file name and
>     optionally the quality 0:100 or -1:100 depends if qt or gtk.
>     I wan to save an image as 600x900 px in 96 dpi but... where specify the
>     dpi? The result is always 300 dpi.
>     Don't see any property in the image object to set the resolution.
> 
>     img = Image.Load("/tmp/input.jpeg").Stretch(600, 900)
>     img.Save("/tmp/output.jpeg")
> 
> 
> I think dpi is a printing term 'dots per inch' and is to to with 
> printing and rendering but has nothing to do with image save data.
> 
> BruceS
> 

DPI is some metadata associated with some image file formats.

At the moment Gambas does not know how to read or write these metadata.

Regards,

-- 
Benoît Minisini


More information about the User mailing list