Last modified: 2014-10-29 23:07:13 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 T74511, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72511 - HTTP 500 errors with certain JPEG thumbnails: "Fractional sampling not implemented yet"
HTTP 500 errors with certain JPEG thumbnails: "Fractional sampling not implem...
Status: NEW
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-25 13:58 UTC by Kelson [Emmanuel Engelhart]
Modified: 2014-10-29 23:07 UTC (History)
6 users (show)

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


Attachments

Description Kelson [Emmanuel Engelhart] 2014-10-25 13:58:55 UTC
For example with:
https://kn.wikipedia.org/wiki/%E0%B2%9A%E0%B2%BF%E0%B2%A4%E0%B3%8D%E0%B2%B0:End-of-the-world-Stephen-Hawking-god-particle-Higgs-boson-508102.jpg

Calling this URL:
http://upload.wikimedia.org/wikipedia/kn/thumb/0/0e/End-of-the-world-Stephen-Hawking-god-particle-Higgs-boson-508102.jpg/230px-End-of-the-world-Stephen-Hawking-god-particle-Higgs-boson-508102.jpg

Generate a HTTP 500 error with message:
Error generating thumbnail

ಮುನ್ನೋಟ ಚಿತ್ರವನ್ನು ಸೃಷ್ಟಿಸುವಲ್ಲಿ ದೋಷ: convert: Fractional sampling not implemented yet `/tmp/localcopy_1924ad5185f8-1.jpg' @ error/jpeg.c/EmitMessage/242.
convert: missing an image filename `/tmp/transform_b82067d9cc5c-1.jpg' @ error/convert.c/ConvertImageCommand/3011.

Error code: 1
Comment 1 Bawolff (Brian Wolff) 2014-10-25 18:09:42 UTC
Appears to be bug in image magick about how it gives size hints to libjpeg.

example test case:

convert -define 'jpeg:size=118x70' End-of-the-world-Stephen-Hawking-god-particle-Higgs-boson-508102.jpg  out.jpg

I've tested on both old image magick, and 6.8.9-3
Comment 2 Bawolff (Brian Wolff) 2014-10-25 19:41:41 UTC
Ah, its related to the file having an invalid YCbCr sampling specification. It specifies "2 3", and as far as I can tell, the valid choices are:

'1 1' = YCbCr4:4:4 
'1 2' = YCbCr4:4:0 
'1 4' = YCbCr4:4:1 
'2 1' = YCbCr4:2:2 
'2 2' = YCbCr4:2:0 
'2 4' = YCbCr4:2:1 
'4 1' = YCbCr4:1:1 
'4 2' = YCbCr4:1:0
Comment 3 Bawolff (Brian Wolff) 2014-10-25 20:05:47 UTC
(In reply to Bawolff (Brian Wolff) from comment #2)
> Ah, its related to the file having an invalid YCbCr sampling specification.
> It specifies "2 3", and as far as I can tell, the valid choices are:

To further that, the "2 3" would denote subsampling with 1/2 resolution in the horizontal direction, and 1/3 in the vertical resolution.

When we ask image magick to scale it with say the -define 'jpeg:size=295x175' option, that hands off the initial scaling to libjpeg, which shrinks it by 50%. As a result it tries to in the vertical direction scale by 3/2 (Since it tries for every 2 vertical samples (from the scaling factor) to return 3 samples (from the subsampling)). But if -define 'jpeg:size=295x175' isn't there, then the full image is decompressed, and the vertical chroma is scaled by the integer 3.

I don't know if this could be considered a bug in image magick, or if libjpeg should handle this better, or if the image is just broken.
Comment 4 Bawolff (Brian Wolff) 2014-10-25 20:42:32 UTC
Well I filed an upstream bug: http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=26434 , but to be honest, I'm not really sure if this is really an image magick bug.
Comment 5 Bawolff (Brian Wolff) 2014-10-25 23:53:53 UTC
upstream says: "We can reproduce the problem you posted and have a patch in ImageMagick 6.8.9-10 Beta, available by sometime tomorrow. Thanks."

----

Of course Wikimedia updates its packages almost never, so it probably won't make it to WMF servers for about seven years.
Comment 6 Kelson [Emmanuel Engelhart] 2014-10-26 00:17:58 UTC
What happens here is pretty incredible... the end too ;)
Comment 7 Kelson [Emmanuel Engelhart] 2014-10-27 11:17:12 UTC
The beta version of imagemagick 6.8.9-10 was released here:
http://www.imagemagick.org/download/beta/ImageMagick-6.8.9-10.tar.bz2
Comment 8 Kelson [Emmanuel Engelhart] 2014-10-28 13:06:21 UTC
Here is my HTTP header dump for http://parsoid-lb.eqiad.wikimedia.org/euwiki/Cebus?oldid=3949332
===
GET /euwiki/Cebus?oldid=3949332 HTTP/1.1
Host: parsoid-lb.eqiad.wikimedia.org
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: fr,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 0
Cookie: GeoIP=CH:Dubendorf:47.3954:8.6184:v4
Connection: keep-alive

HTTP/1.1 200 OK
X-Powered-By: Express
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: private,no-cache,s-maxage=0
content-revision-id: 3949332
X-Parsoid-Performance: duration=270362; start=1414501238071
Content-Type: text/html; charset=UTF-8
Content-Encoding: gzip
X-Varnish: 497764938, 820175809
Via: 1.1 varnish, 1.1 varnish
Content-Length: 2646
Accept-Ranges: bytes
Date: Tue, 28 Oct 2014 13:05:08 GMT
Age: 0
Connection: keep-alive
X-Cache: cp1058 miss (0), cp1058 frontend miss (0)
Comment 9 Kelson [Emmanuel Engelhart] 2014-10-29 23:07:13 UTC
Sorry for my last comment, is not for this bug report.

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


Navigation
Links