After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 719723 - Drag and drop of sRGB image crashes GIMP
Drag and drop of sRGB image crashes GIMP
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
2.8.10
Other Mac OS
: Normal critical
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2013-12-02 21:35 UTC by Slava
Modified: 2016-04-17 16:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
jpg (132.00 KB, image/jpeg)
2013-12-02 21:36 UTC, Slava
Details

Description Slava 2013-12-02 21:35:10 UTC
when drag n drop pic, gimp crashes
seems app cant eat the color profile
Comment 1 Slava 2013-12-02 21:36:41 UTC
Created attachment 263340 [details]
jpg
Comment 2 Jehan 2013-12-03 00:15:01 UTC
Hi,

Thanks for the report. I could not reproduce your crash, whatever with gimp-2-8 branch and master, on Linux.
On gimp-2-8, I do get some errors on terminal about problematic XMP metadata and a message about what seems to be a duplicate (?) profile though:

---------------
While parsing XMP metadata:
Error on line 70 char 1: End of element <exif:Flash> not expected in this context

Metadata parasite seems to be corrupt
lcms: skipping conversion because profiles seem to be equal:
 sRGB IEC61966-2.1
 sRGB built-in
----------------

If the source of the crash is the EXIF data, well it seems fixed on GIMP master where we have a new metadata handling system, because I don't see any error there and I can inspect the metadata with the new dialog. The problem still exists on gimp-2-8 but I don't know if anyone will take the time to fix this while we know all this code will soon be gone with the next major release.

If the source of your crash is indeed the profile issue, maybe the lcms library reacts differently on Mac than Linux and there is something to fix indeed because GIMP should not crash.

I have not investigated the code much further though.
What made you think the crash was the color profile in particular? Did you get any error messages? If so, could you write them down here?

Maybe you can also test to remove the profile and see if GIMP loads the image just fine.

For instance with ImageMagick, you can run the `convert` command with "+profile icc" and it should remove the profile labelled "sRGB IEC61966-2.1" (don't use the -strip option! It would remove all metadata apparently, and that would not help the diagnosis on whether the problem is on the profile or the rest of the metadata).
See http://www.imagemagick.org/script/command-line-options.php#profile

*ATTENTION*: I guess you don't want to overwrite the same file inline! You want to create a new jpeg without the profile and keep the original! Check out the `convert` manual before you try random conversion.
Of course you can also use any other program able to strip out profiles for the same effect.

Then tell us if GIMP is able to open the image without no profile.
Thanks.
Comment 3 Jehan 2013-12-03 00:49:19 UTC
Hi again Slava,

Recently released GIMP 2.8.10 has a bugfix relative to a crash on a missing RGB profile. Maybe this is related and it would fix your issue too.

Could you please install the last version (2.8.10) and report back to us?
Thanks.
Comment 4 Slava 2013-12-03 21:11:33 UTC
Sorry Friend
dont have Xcode. I havent install 10.9 yet, chkd reviews today and still see no progress. i got 2011 MBR 
fully lock n load, I often hear facts (including old fellas)  that perverts from CA make such new OS with  system performance decreasing n battery life down to push users to buy new models intentionally. Missing backup feature alludes too.

SO Friend, if u suggest how to cook tar.bz2 i run it immediately.

For my profile guess -just idea, i worked with plenty files - all went smooth.

(In reply to comment #3)
> Hi again Slava,
> 
> Recently released GIMP 2.8.10 has a bugfix relative to a crash on a missing RGB
> profile. Maybe this is related and it would fix your issue too.
> 
> Could you please install the last version (2.8.10) and report back to us?
> Thanks.
Comment 5 Jehan 2014-01-16 03:16:42 UTC
Hello Slava,

I am sorry, but I did not really understand your last message. When you say "i worked with plenty files - all went smooth", are you saying you updated GIMP to the last version (2.8.10) and it does not crash anymore? If so, I guess this report is to be closed as fixed. :-)
Comment 6 Michael Natterer 2014-02-09 00:21:08 UTC
Slava, can you try the latest 2.8.10 dmg and report back please?
Comment 7 ZWard117 2014-03-03 22:29:06 UTC
This bug still seems to be present in the 2.8.10 release on OS X 10.9 Mavericks.
Anything I can do to help?
Comment 8 Michael Natterer 2014-03-03 23:26:16 UTC
Yes could you please run GIMP in gdb and get us a stack trace of the crash?
Comment 9 ZWard117 2014-03-04 00:02:19 UTC
Sorry,
As I'm not on my stand OS (win7-64) and I am on OSX 10.9, I don't remember how to do that. 
Sorry again,
Ward
Comment 10 Yoav Moran 2014-04-15 08:03:23 UTC
The same thing happens on my mac. I have Maverick OS, I created a screenshot, and then with the Finder went to Desktop and dragged the screenshot to Gimp. Each time I do that - Gimp crashes.
I installed Gimp 2.8.10.
Comment 11 Jehan 2014-04-15 19:12:50 UTC
Yoav, or anyone else encountering such trace, could you please provide the stack trace of the crash please? Thanks.
Comment 12 Yoav Moran 2014-04-15 19:36:30 UTC
Can you please explain how it can be done? I'm not that expert in mac...
Comment 13 Jehan 2014-04-15 19:50:47 UTC
Hi Yoav,

You'll find all the explanation on this link: https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces/Details#obtain-a-stacktrace

Thanks!
Comment 14 Simone Karin Lehmann 2014-04-16 15:42:50 UTC
I've fixed this bug (and some others too) by more or less completly rewriting the gtk-osx-integration library. The current implementation of gtk-osx-integration uses an undocumented Cocoa function call to build the menu programtically and therefor needs to wait until the application has finished setting up the menus. After the menus have been set up, the Cocoa core gets informed that the application has finished launching. This made it necessary in GIMP to register a separete event handler for drag and drop events in addition to the use of the application delegete methods. This double event handling somehow triggers this bug.

By rewriting the library to use pure documented Cocoa and not to hide the delegate and notification protocols, I got the chance to inform the Cocoa code much ealier about finished launching, and could use the application delegate object to completly handle all open file events. This completly fixed this bug. I'll update my repository with the new library as soon as possible and of course will send the whole code to upstream as well.
Comment 15 Jehan 2014-04-16 20:08:53 UTC
Nice to hear it! Thanks Simone. We are looking forward your patch about this then. :-)
Comment 16 ZWard117 2014-05-06 20:40:38 UTC
Sorry all. Ended up moving and also severely damaging my shoulder this winter. Finally able to use it again so I apologize. Any idea about a time stamp for this fix?
Comment 17 Michael Schumacher 2014-05-09 13:21:59 UTC
Should we move this bug to GTK+ then, if it has to be solved there anyway?
Comment 18 Jehan 2014-05-21 07:03:56 UTC
Hi Michael,

Maybe I missed something, but I don't think it has been said it has already been solved in GTK+. From the history of this report, last relevant info was that Simone said she had a patch ready for this specific problem. Though maybe you meant that gtk-osx-integration is Simone's fork of GTK+? In this case, yes this report should be relabelled.

In any case, Simone, what is the status of this? Would it be possible to upload your patch here? Have you done so already on a separate report? (in this case, which bug id?)
Thanks!
Comment 19 Max Mustermann 2014-05-26 18:59:23 UTC
I tried today with my GIMP 2.8.11 build of the build-osx branch which is based on GIMP 2.8 (commit c4dc168 from 25.05.2014) and uses lcms 1.19. 
I can confirm that GIMP doesn't crash anymore. It still shows the error message from comment 2, but keeps running. 
For the GIMP users this means that it should work in the next release GIMP 2.8.12.
Comment 20 Slava 2014-06-19 09:29:13 UTC
friend,pls give link to files
(In reply to comment #19)
> I tried today with my GIMP 2.8.11 build of the build-osx branch which is based
> on GIMP 2.8 (commit c4dc168 from 25.05.2014) and uses lcms 1.19. 
> I can confirm that GIMP doesn't crash anymore. It still shows the error message
> from comment 2, but keeps running. 
> For the GIMP users this means that it should work in the next release GIMP
> 2.8.12.
Comment 21 Simone Karin Lehmann 2014-06-19 13:00:12 UTC
I've already posted this to the devel list, but to keep the bug tracker in sync...

I’ve just uploaded my patched version of the gtk-mac-integration library and committed it into my svn repository. 

https://sourceforge.net/p/gimponosx/code/HEAD/tree/gtk-mac-integration/

The README gives some information about why I did this, as I already mentioned in my above quoted posting, and gives some basic documentation about how to use the library.

I’ve patched GIMP’s 2.8.10 sources to use this forked library. The changes are in app/gui/gui.c and app/gui/gui-unique.c. You can find the patches in my svn too at

https://sourceforge.net/p/gimponosx/code/HEAD/tree/GimpPorts/ports/graphics/gimp2/files/
Comment 22 Max Mustermann 2014-06-19 17:23:51 UTC
The source is here: https://git.gnome.org/browse/gimp?h=osx-build.
It is work in progress and planned to be in the upcoming 2.8.12 release. Please be a bit patient.
If you want to build yourself for OS X, you can get the sources from the link above. Be sure to pull the osx-build branch.
Comment 23 Michael Schumacher 2015-06-06 09:50:58 UTC
Does this still happen with 2.8.14?
Comment 24 Michael Schumacher 2015-12-30 12:06:18 UTC
... or 2.8.16?
Comment 25 Kristian Rietveld 2016-04-17 12:51:03 UTC
With GIMP 2.8.16 on OS X 10.11, GIMP itself does not crash, but the file-jpeg plugin does. The error that is shown is similar:

** (file-jpeg:41748): WARNING **: JPEG - unable to decode XMP metadata packet
lcms: skipping conversion because profiles seem to be equal:
 sRGB IEC61966-2.1
 sRGB built-in
Comment 26 Kristian Rietveld 2016-04-17 13:05:37 UTC
With GIMP master no error is shown and the plugin does not crash.
Comment 27 Kristian Rietveld 2016-04-17 16:39:40 UTC
The error message shown by the file-jpeg plugin has been fixed in gimp-2-8. Note that this message was only shown if the metadata plugin was not built, which is not built when libexif is not available.

It's probable that the error message generated by the plugin made you believe that Gimp had crashed.


commit 5abf0bb35763fb3ebe56bd96298f852adb423e51
Author: Kristian Rietveld <kris@loopnest.org>
Date:   Sun Apr 17 17:22:12 2016 +0100

    Bug 719723 - Drag and drop of sRGB image crashes GIMP

    In file-jpeg, move the HAVE_LIBEXIF define down to include the call
    to the metadata plugin (pdb-in-metadata-decode-xmp). This is necessary
    because the metadata plugin is only available if GIMP was configured
    with HAVE_LIBEXIF.