GNOME Bugzilla – Bug 658610
Warn when importing PNG images with an offset
Last modified: 2013-01-09 13:22:45 UTC
Hi, I just found that gimp (Ubuntu 11.04 and 11.10) does not read a png file correctly, there is something missing at the bottom (or the content seems to be shifted downwards, since there seems to be a transparent part above the image). I am not sure wether the problem is in gimp itself or a png library. However, both eog and gimp use the same libpng12.so , and eog works correctly. Fetch the example file from http://www.danisch.de/tmp/in.png regards Hadmut
That's because the PNG file has an y offset of 279: $ identify ~/Desktop/in.png /home/martin/Desktop/in.png PNG 4566x1141 4566x1141+0+279 8-bit DirectClass 12.1MB 0.000u 0:00.000 Note 279 in 4566x1141+0+279. You're not the first one confused by this. IMO we should add a dialog when importing offsetted PNG images that says something like: The PNG image you are importing have a specified offset of x = 0, y = 279. Do you want to apply this offset to the layer? [Apply PNG offset to layer] [Ignore PNG offset] Unless there are objections I will do this soonish.
Absolutely no objections.
It would also be nice to add this after the apply/ignore buttons: [X] Remember this decision for other PNG images or "Do not ask again"
Yes that would be nice, but we really can't have such checboxes in plugins until we have a way to manage such persistently stored plugin settings. Otherwise the checkbox will be hidden for good unless you rm ~/.gimp
Wouldn't a nice solution be something like adding the png offset to the layer as a parasite and adding UI to point out where a newly added layer (or the active layer) is located if it isn't shown in the visible part of the image window? This could also include a way to disregard the offset and move it into the currently visible part. Oh, and we should make sure to research why there are images with offsets even if the people using them don't suspect that- i.e. what created those images.
Actually, this is a perfect thing to give to someone that says "I am a programmer and want to help but I don't know with what". Setting gnome-love keyword.
*** Bug 568835 has been marked as a duplicate of this bug. ***
where can I get the source code of this file so that I can work for patch. I am a student/programmer and I want to work for its fix. Since Martin Nordholts has already said it's easier for new comers so I think it would be great to work on this bug.
git clone git://git.gnome.org/gimp
Created attachment 207206 [details] [review] PNG offsets dialog
Sorry, I'm new to Bugzilla. I wanted to comment on the patch. I haven't produced a patch with git before, so I hope it works. Also, RUN-NONINTERACTIVE should still apply the offset.
Thanks, that patch looks really good for a first one, in fact it's almost perfect. Will push with some minor changes.
Fixed in master: commit f07b9606d833fe36009653be4fc2ae558efa23ad Author: Ville Sokk <embassyhill@gmail.com> Date: Thu Feb 9 20:09:14 2012 +0200 Bug 658610 - Warn when importing PNG images with an offse Added a dialog about offsets to the PNG loader plug-ins/common/file-png.c | 87 ++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 80 insertions(+), 7 deletions(-) commit ddb1f968b5355bc94db5d279ff76e207998353cf Author: Michael Natterer <mitch@gimp.org> Date: Sun Feb 12 18:41:52 2012 +0100
*** Bug 691398 has been marked as a duplicate of this bug. ***