Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 372941 - media-gfx/gimp file-uri plugin crash
Summary: media-gfx/gimp file-uri plugin crash
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Hanno Böck
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-25 04:35 UTC by Jared B.
Modified: 2011-09-02 18:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
uri-backend-libcurl.diff (uri-backend-libcurl.diff,2.52 KB, patch)
2011-06-25 04:36 UTC, Jared B.
Details | Diff
gimp-2.6.11-r1.diff (gimp-2.6.11-r1.diff,470 bytes, patch)
2011-06-25 04:37 UTC, Jared B.
Details | Diff
uri-backend-libcurl-2.6.patch (uri-backend-libcurl-2.6.patch,2.16 KB, text/plain)
2011-09-01 14:30 UTC, Jared B.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jared B. 2011-06-25 04:35:31 UTC
The GIMP package in portage, for some time now, fails to load images from remote sites using either the File, Open Location... option or by trying to load a URL through the command line (eg., gimp http://domain.com/image.jpg).

GIMP relies on curl for this functionality (or at least the portage version does), and I've confirmed that curl support is enabled, but it still fails.  It'll download the file - you can see the progress of the download - but then fail when trying to actually load it.  I don't have a screenshot of the error message from the GUI, but it was something vague along the lines of "operation failed".  If I open GIMP from the command line, it reports this:

/usr/lib64/gimp/2.0/plug-ins/file-uri: fatal error: Segmentation fault

There's been a lot of discussion about this problem on the Arch bug tracker here:
https://bugs.archlinux.org/task/12321

They've supplied a patch to fix the problem, which I've tested against the current stable version of GIMP, and it works great.  I've attached the patch to this bug for convenience.  Please include this patch so that remote images can be properly opened in GIMP once again.

Thanks.

Reproducible: Always
Comment 1 Jared B. 2011-06-25 04:36:16 UTC
Created attachment 278067 [details, diff]
uri-backend-libcurl.diff
Comment 2 Jared B. 2011-06-25 04:37:53 UTC
Created attachment 278069 [details, diff]
gimp-2.6.11-r1.diff

Small, and probably unnecessary, patch to the stable ebuild to add support for the file-uri fix.
Comment 3 Sebastian Pipping gentoo-dev 2011-08-31 12:21:46 UTC
(In reply to comment #1)
> Created attachment 278067 [details, diff]
> uri-backend-libcurl.diff

What I see in this patch:
1) Adding support for gopher: URIs
2) Moving response_code from gint to glong
3) Adding a function uri_backend_map_image
4) Treating HTTP response code 226 as success, too

Especially (3) puzzles me, as function uri_backend_map_image does not seem to be used elsewhere in the patch.

Could you explain how these changes fix the problem?
Comment 4 Jared B. 2011-08-31 14:15:59 UTC
No, I'm afraid I can't.  As mentioned in my description, I found that patch on the Arch bug tracker, tried it in desperation, and it just worked.  I'm not a C/C++ programmer, so I normally don't worry too much about *how* it works, as long as it fixes my problem.  :-)

There's a long discussion about this on the Arch thread, so you can probably find answers to most of your questions there.  Also, I just took another look at the thread, and it looks like this was submitted and accepted upstream about a week after I posted it.  Here's the bug report and resultant discussion from that:
http://bugzilla-attachments.gnome.org/attachment.cgi?id=191340

It's different from what I submitted here, and seems to omit the uri_backend_map_image function while also including support for https.  It's probably the better patch.  If you'd like, I'll be happy to test and verify it when I get home tonight.
Comment 5 Jared B. 2011-09-01 14:30:23 UTC
Created attachment 285247 [details]
uri-backend-libcurl-2.6.patch

I just realized that I linked directly to the the upstream patch rather than upstream bug report.  Here's the correct link:
https://bugzilla.gnome.org/show_bug.cgi?id=653980

Also, I tested that patch and it also works.  I had to make a couple changes to get it to apply to the 2.6 version in portage, though, so I've attached a lightly edited version to this bug report.

Does this one look better?
Comment 6 Sebastian Pipping gentoo-dev 2011-09-02 17:40:11 UTC
(In reply to comment #5)
> I just realized that I linked directly to the the upstream patch rather than
> upstream bug report.  Here's the correct link:
> https://bugzilla.gnome.org/show_bug.cgi?id=653980

Thanks!


> Also, I tested that patch and it also works.  I had to make a couple changes to
> get it to apply to the 2.6 version in portage, though, so I've attached a
> lightly edited version to this bug report.

Looks like you ported
http://git.gnome.org/browse/gimp/commit/?id=039d4636f84ade6387216e347f5af597f43b99fc
for me.  Thanks!


> Does this one look better?

The cases of loading remote images I tested didn't work well (or better) but that may be my config or the server I tested with.  I trust that it improves the situation for you and that upstream put thought into it.

+*gimp-2.6.11-r3 (02 Sep 2011)
+
+  02 Sep 2011; Sebastian Pipping <sping@gentoo.org> +gimp-2.6.11-r3.ebuild,
+  +files/gimp-2.6.11-file-uri.patch:
+  Apply file-uri patch by upstream (bug #372941)
+

Closing.
Comment 7 Jared B. 2011-09-02 17:46:00 UTC
Thanks Sebastian.  I'm happy to help where I can, especially if it means one less package to keep in my local overlay.  :-)

On the issue of it not working for you, this is probably a stupid question, but do you have the curl flag enabled for gimp?  I overlooked this for a while when initially troubleshooting this.  With USE=curl and the new patch, remote image loading works great for me on the two boxes I've tested.
Comment 8 Sebastian Pipping gentoo-dev 2011-09-02 18:40:17 UTC
(In reply to comment #7)
> Thanks Sebastian.  I'm happy to help where I can, especially if it means one
> less package to keep in my local overlay.  :-)

That's in my interest, too.  Good attitude.


> On the issue of it not working for you, this is probably a stupid question, but
> do you have the curl flag enabled for gimp?  I overlooked this for a while when
> initially troubleshooting this.  With USE=curl and the new patch, remote image
> loading works great for me on the two boxes I've tested.

Good point, I seem to have USE=-curl here.