GNOME Bugzilla – Bug 314742
saving PNG as JPG produces garbled image.
Last modified: 2005-10-29 23:20:31 UTC
Distribution/Version: ubuntu hoary I took a capture of a window using ALT+PrintScr, and saved it as a PNG. I then opened that image up in EOG and saved it as a jpeg. The image was messed up. I will attach the PNG and resulting JPEG
Created attachment 51487 [details] tarball of the source PNG and the resulting JPEG
This seems to be a problem with images containing an alpha channel. It works if you use 8-bit PNGs or a PNG without alpha channel.
Created attachment 53760 [details] [review] patch fixing RGBA->RGB conversion This patch should fix it. The problem was that the loop converting the RGBA data to RGB data always skipped 3 bytes when advancing to the next pixel. RGBA data is 4 pixels wide though. The patch changes the loop so it calculates the size of a pixels data through the rowstride and the images width.
Applied, thanks!
*** Bug 320155 has been marked as a duplicate of this bug. ***