GNOME Bugzilla – Bug 620911
gdk_pixbuf_save() PNG when compression option not last in list
Last modified: 2011-12-16 21:42:04 UTC
Created attachment 162983 [details] failing program If the png format "compression" option to gdk_pixbuf_save() is not last in the options list then an incorrect tEXt property is written to the file. The attached foo.c creates a foo.png which has a tEXt property "ssion" with value "9", where I hoped it would be property "Title" with value "blah". The latter is what you get if the compression option is last in the options list instead of first.
Thanks for the test program !
The following fix has been pushed: 23cdf12 Fix handling of options when saving pngs
Created attachment 203702 [details] [review] Fix handling of options when saving pngs The png loader treats its options in two passes, the first pass counts and verifies them, the second pass converts text options. This worked ok when only text was understood, but with the introduction of compression and icc-profile as supported options, the two loops can now get out of sync when the text options are not all at the beginning. Fix this by skipping non-text options in the second loop, just as we do in the first loop.