Last modified: 2012-03-30 20:49:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T19959, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17959 - Inline rendering/thumbnailing for Gimp XCF images
Inline rendering/thumbnailing for Gimp XCF images
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
unspecified
All All
: Low enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://commons.wikimedia.org/wiki/Fil...
: patch, patch-need-review
Depends on:
Blocks: 35622
  Show dependency treegraph
 
Reported: 2009-03-12 19:56 UTC by Brion Vibber
Modified: 2012-03-30 20:49 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
proposed patch (5.33 KB, patch)
2009-03-16 19:30 UTC, Ahmad Sherif
Details
another patch and a python script (2.23 KB, application/zip)
2009-03-20 22:38 UTC, Ahmad Sherif
Details
the patch (4.89 KB, patch)
2009-03-20 23:16 UTC, Ahmad Sherif
Details
python script to interact with pixbuf loader (592 bytes, text/x-python)
2009-03-20 23:18 UTC, Ahmad Sherif
Details
adding a missing line (5.05 KB, patch)
2009-03-23 22:34 UTC, Ahmad Sherif
Details
Rendering of File:%22What_a_Brilliant_Idea!%22_Barnstar.xcf with ImageMagick vs GIMP (75.49 KB, image/png)
2011-12-26 23:18 UTC, Bawolff (Brian Wolff)
Details

Description Brion Vibber 2009-03-12 19:56:22 UTC
Some images on Wikipedia/Commons/etc have been uploaded in Gimp's XCF format; as a work format this is pretty good since it supports multiple layers, editable text, various effects etc -- and Gimp is free software, so anyone can download it and edit the source file.

However, we don't currently support in-wiki rendering of the XCF files, so you need to separately upload a flattened PNG or JPEG file.

To save this extra manual step and simplify the workflow, XCF images could be rendered by shelling out to Gimp, or with alternate loaders such as this GdkPixBuf loader: http://blog.reblochon.org/2009/03/gift-to-competition.html
Comment 1 Ahmad Sherif 2009-03-16 19:30:05 UTC
Created attachment 5937 [details]
proposed patch

This patch may help. It uses one of xcftools software, xcf2png, which works only on linux and unix-like systems.
Comment 2 Brion Vibber 2009-03-16 21:06:22 UTC
Looks like this package:
http://henning.makholm.net/xcftools/

Good news:
* xcftools package is included in Debian and Ubuntu -- would be easy to deploy to image scaler boxes!

Bad news:
* Site's down and last release seems to be in 2006; unmaintained software? :(
* xcf2png does not appear to do scaling itself. The attached patch does post-scaling with GD, which will fail when GD is not available; it also seems to be rendering to stdout and buffering the whole thing into PHP-managed memory, making it more likely to fail on large images.

If we can't skip the step on scaling, might be safer to output to a temporary file and then scale that, potentially with ImageMagick or whatever the default for rasters is.

I haven't done any testing yet to confirm compatibility on xcf2png.
Comment 3 Ahmad Sherif 2009-03-20 22:38:13 UTC
Created attachment 5944 [details]
another patch and a python script

> Bad news:
> * Site's down and last release seems to be in 2006; unmaintained software? :(
> * xcf2png does not appear to do scaling itself. The attached patch does
> post-scaling with GD, which will fail when GD is not available; it also seems
> to be rendering to stdout and buffering the whole thing into PHP-managed
> memory, making it more likely to fail on large images.

So we can use the Pixbuf loader mentioned above in association with a simple script (e.g. python with gdk bindings) to eliminate this problem.

> Good news:
> * xcftools package is included in Debian and Ubuntu -- would be easy to deploy
> to image scaler boxes!
It's easy to deploy this loader but not as easy as xcftools :). i think that this loader may help doing the work under windows too.
Comment 4 Mike.lifeguard 2009-03-20 23:13:44 UTC
Could you please attach the patch separately from anything else? Otherwise, we cannot view it on bugzilla.
Comment 5 Ahmad Sherif 2009-03-20 23:16:31 UTC
Created attachment 5945 [details]
the patch
Comment 6 Ahmad Sherif 2009-03-20 23:18:01 UTC
Created attachment 5946 [details]
python script to interact with pixbuf loader
Comment 7 Ahmad Sherif 2009-03-23 22:34:14 UTC
Created attachment 5954 [details]
adding a missing line

Adding a missing line wasn't in the first patch.
Comment 8 p858snake 2011-04-30 00:10:05 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Comment 9 Sumana Harihareswara 2011-11-10 06:42:41 UTC
Ahmad, thank you for your patches, and my apologies on the late response.  I've added the "need-review" keyword to indicate that developers should review your code.
Comment 10 Bawolff (Brian Wolff) 2011-11-10 17:41:50 UTC
Comment on attachment 5946 [details]
python script to interact with pixbuf loader

To start with, an XCFHandler, should probably be an extension and not in core (but that's really a trivial change, and not a major issue with the patch).


(also changing mime type on python file so that hopefully it is not forced-download)
Comment 11 Mark A. Hershberger 2011-12-26 18:56:02 UTC
Check out https://en.wikipedia.org/wiki/File:%22What_a_Brilliant_Idea!%22_Barnstar.xcf for an example file.  (Found this while investigating another bug.)

ImageMagick will work with this.  I have a bit of work done that will work with convert.
Comment 12 Brion Vibber 2011-12-26 19:01:57 UTC
Sounds like we need two things:

* a PHP-native 'getimagesize' implementation for XcfHandler to extract the width/height of the contained image from the file header
* wrappers for calling ImageMagick's convert and/or the gdkpixbuf loader to generate scaled PNGs

Mark, can you post what you have on the bug or check in an initial XcfHandler extension? This'd be handy to have. :)
Comment 13 Bawolff (Brian Wolff) 2011-12-26 23:18:14 UTC
Created attachment 9764 [details]
Rendering of File:%22What_a_Brilliant_Idea!%22_Barnstar.xcf with ImageMagick vs GIMP

(In reply to comment #11)
> Check out
> https://en.wikipedia.org/wiki/File:%22What_a_Brilliant_Idea!%22_Barnstar.xcf
> for an example file.  (Found this while investigating another bug.)
> 
> ImageMagick will work with this.  I have a bit of work done that will work with
> convert.

Perhaps my version of ImageMagick is outdatated, but it seems not to support lots of the features of GIMP. See screenshot. OTOH, arguably it might be better to have crappy thumbnailing than no thumbnailing.

Relevant versions:

bawolff@Bawolff-L:~$ gimp --version
GNU Image Manipulation Program version 2.6.10


bawolff@Bawolff-L:~$ display --version
Version: ImageMagick 6.6.0-4 2010-11-16 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP
Comment 14 Mark A. Hershberger 2011-12-27 00:55:39 UTC
r107351

(In reply to comment #12)
> * a PHP-native 'getimagesize' implementation for XcfHandler to extract the
> width/height of the contained image from the file header

I leave that to someone else.  I was lazy and use ImageMagick's identify :P

> * wrappers for calling ImageMagick's convert and/or the gdkpixbuf loader to
> generate scaled PNGs

Bawolff is right.  ImageMagick's support for XCF is buggy.  Still what I committed is a start.  Maybe use gimp and the stdin script from

http://stackoverflow.com/questions/5794640/how-to-convert-xcf-to-png-using-gimp-from-the-command-line
Comment 15 Antoine "hashar" Musso (WMF) 2012-01-13 16:14:35 UTC
identify was replaced with a 100% PHP implementation with r108141.

Should we consider this bug as fixed ? :)
Comment 16 Mark A. Hershberger 2012-01-13 20:49:45 UTC
After talking to people on Commons, doing some sort of thumbnailing for XCF is a start, even with the buggy ImageMagick implementation.  Since hashar replaced identify in r108141, we should now start working with the ImageMagick community to improve the thumbnailing.
Comment 17 Mark A. Hershberger 2012-01-13 21:47:13 UTC
http://commons.wikimedia.beta.wmflabs.org/wiki/File:Tmp4.xcf -- reopening since the main image on the page should have some sort of displayable version like the pdf thumbnails do.

File history is fine, though.
Comment 18 Bawolff (Brian Wolff) 2012-01-14 22:37:14 UTC
Looks fine to me?
Comment 19 Bawolff (Brian Wolff) 2012-01-14 22:42:32 UTC
(In reply to comment #18)
> Looks fine to me?

Oh nevermind, i see this was fixed in r107351 by the time i looked at link.
Comment 20 Antoine "hashar" Musso (WMF) 2012-01-15 11:03:52 UTC
(In reply to comment #17)
> the main image on the page should have some sort of displayable version like
> the pdf thumbnails do.

Had to force rendering since browsers can not render XCF :-)
r108862

Thanks Bawolff for cross checking.
Comment 21 Marco 2012-03-30 17:04:39 UTC
(In reply to comment #16)
> After talking to people on Commons, doing some sort of thumbnailing for XCF is
> a start, even with the buggy ImageMagick implementation.  Since hashar replaced
> identify in r108141, we should now start working with the ImageMagick community
> to improve the thumbnailing.

Thumbnailing should really be improved. There are some major flaws:
*Grey scale XCF-files become green ( http://commons.wikimedia.org/wiki/File:Australian_English_IPA_vowel_chart.xcf )
*XCF-files with layers get screwed up generally ( http://commons.wikimedia.org/wiki/File:Gimp_layer_mode_test.xcf )
Comment 22 Mark A. Hershberger 2012-03-30 20:49:39 UTC
(In reply to comment #21)
> Thumbnailing should really be improved.

This issue is tracked on Bug 35622

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links