[Gambas-user] Picture.ToString() ?

Bruce Steers bsteers4 at gmail.com
Thu Jan 4 01:55:57 CET 2024


On Wed, 3 Jan 2024 at 23:17, Bruce Steers <bsteers4 at gmail.com> wrote:

>
>
> On Wed, 3 Jan 2024 at 23:09, Claus Dietrich <claus.dietrich at freenet.de>
> wrote:
>
>> Hi Bruce
>>
>> Am 03.01.24 um 23:44 schrieb Bruce Steers:
>> > I do not know if any other formats support quality (i thought only jpeg)
>>
>> png also supports "quality". As png is lossless the argument is mapped
>> to compression and leads to different filesizes (100 = maximum filesize
>> and 0 = minimum filesize).
>>
>> Best regards
>>
>> Claus
>>
>
> I get the following message if i pass any quality value...
>
> Dim sPic As String = Picture["icon:/16/gambas"].ToString("png", 100)
>
> GdkPixbuf-WARNING **: 23:11:20.946: Unrecognized parameter “quality”
> passed to the PNG saver
>
>
> although sPic does get filled with the image string
>
> (sorry it's a warning so not technically an error)
>

It seems GdkPixBuf does only support the quality flag with saving JPEG.
https://docs.gtk.org/gdk-pixbuf/method.Pixbuf.save.html
(i just put that link in the wiki to fix the current broken link @
https://gambaswiki.org/wiki/comp/gb.qt4/image/save)

I did a test and like you say jpeg saving saves as different file sizes and
quality but png does not, it prints the warning message and the file size
of quality 10 and 100 are both the same.

Quote from the page:

Currently only few parameters exist.

JPEG images can be saved with a “quality” parameter; its value should be in
the range [0, 100]. JPEG and PNG density can be set by setting the “x-dpi”
and “y-dpi” parameters to the appropriate values in dots per inch.

etc, etc

Respects

BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240104/ebf48473/attachment.htm>


More information about the User mailing list