Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 10138 [details]
read.png is the original file.
libgdiplus does not properly handle PNG_COLOR_TYPE_PALETTE files with 2 bits per pixel. I'm attaching two files to show what happens. I've figured out a non-ideal fix for this, and will post a pull request with that fix. (The ideal fix would be to change libgdiplus to use libpng properly, and fix libpng to handle this case properly. Since the current libgdiplus code was already trying to work around the effects of not calling libpng properly, I made a minimal change to its current code.)
Created attachment 10139 [details]
read-munged.png is the file as displayed and saved, going through Mono Graphics and libgdiplus
See https://github.com/mono/libgdiplus/pull/30 for my proposed fix.
The PR was merged. Thanks!