Last modified: 2012-10-26 20:58:07 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 T38580, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 36580 - Fix PDF rendering by upgrading image scaler Ghostscript to 9.05+
Fix PDF rendering by upgrading image scaler Ghostscript to 9.05+
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
PdfHandler (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: 36594 26388 36623
Blocks: 23652 23326
  Show dependency treegraph
 
Reported: 2012-05-07 00:58 UTC by Smallman
Modified: 2012-10-26 20:58 UTC (History)
4 users (show)

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


Attachments
How it looks rendered on the wiki (257.96 KB, image/png)
2012-05-07 00:58 UTC, Smallman
Details
How it looks in adobe reader. (31.18 KB, image/png)
2012-05-07 00:58 UTC, Smallman
Details
Rendered with gs 9.05 (155.88 KB, image/jpeg)
2012-05-07 14:56 UTC, Marcin Cieślak
Details
gs 9.05 rendered file processed by convert Version: ImageMagick 6.7.5-7 2012-03-07 Q16 (45.46 KB, image/jpeg)
2012-05-07 14:58 UTC, Marcin Cieślak
Details

Description Smallman 2012-05-07 00:58:22 UTC
Created attachment 10524 [details]
How it looks rendered on the wiki

The pdf file at:
https://commons.wikimedia.org/wiki/File:Welcome2WP_English_082310.pdf

doesn't seem to render properly. The 1st page color is off, and the image looks heavily compressed.
Comment 1 Smallman 2012-05-07 00:58:59 UTC
Created attachment 10525 [details]
How it looks in adobe reader.
Comment 2 Mark A. Hershberger 2012-05-07 14:22:48 UTC
From #ghostscript:

<Robin_Watts> hexmode: What are you using to do thumbnailing ?  [09:57]
<hexmode> Robin_Watts: gs
<Robin_Watts> hexmode: What version of gs ?  [09:58]
<Robin_Watts> Versions of gs prior to 9.00 will not have handled color
              profiles correctly, which means you may see slight colour
              shifts.  [09:59]
<hexmode> Robin_Watts: I'll double check but the cluster runs Ubuntu Lucid by
          default: http://packages.ubuntu.com/lucid/ghostscript
<hexmode> ah, that is prior to 9.00
<hexmode> :)
<hexmode> I'll add that to the bug
<hexmode> and ask ops to upgrade
<Robin_Watts> BUT... I'd consider using mupdf rather than gs.
<Robin_Watts> MuPDF does not handle color profiles either, but for PDF files
              with text in, the antialiasing given is MUCH nicer (and faster).
                                                                        [10:00]
<Robin_Watts> gs is by far the better choice when running for print output.
                                                                        [10:01]
<Robin_Watts> mupdf is optimised for screen output, so may be a better bet for
              what you need.  [10:02]
<hexmode> I wasn't aware of MuPDF  [10:03]
<Robin_Watts> Also, it would be good to see the exact command used by the
              wikimedia cluster, because the options used can have a large
              effect.
<Robin_Watts> muPDF is from the same company that maintains gs, and is
              released under the same license.
<Robin_Watts> That looks a lot like you're rendering to JPEG - the ringing
              artifacts etc.  [10:04]
<chrisl> It is a jpeg.  [10:09]
<chrisl> hexmode: if you are stuck with the GS 8.x (I think in Lucid) you can
         try using the -dUseCIEColor command line option.  [10:11]
<hexmode> chrisl: that's probably the best shot at this point. tyvm  [10:12]
<chrisl> hexmode: the "heavily compressed" effect is, as Robin_Watts
         mentioned, because it's jpeg compressed - the solution is: don't use
         jpeg.....  [10:13]
<hexmode> chrisl: yeah, don't know why they didn't use png
<chrisl> png would be my choice, yes  [10:14]
Comment 3 Marcin Cieślak 2012-05-07 14:47:33 UTC
Looks like we are doing

gs -sDEVICE=jpeg -sOutputFile=- -dFirstPage={$page} -dLastPage={$page}
  -r{$wgPdfHandlerDpi} -dBATCH -dNOPAUSE -q <sourcefile> | convert -depth 8 -resize ${width} - 

We could probably do better (get rid of convert and optimize gs JPEG output a bit)
Comment 4 Marcin Cieślak 2012-05-07 14:56:32 UTC
Created attachment 10531 [details]
Rendered with gs 9.05

PDF file rendered with

gs -sDEVICE=jpeg -sOutputFile=after_gs.jpeg -dFirstPage=1 -dLastPage=1 -r150 -dBATCH -dNOPAUSE -q Welcome2WP_English_082310.pdf with GPL Ghostscript 9.05 (2012-02-08)
Comment 5 Marcin Cieślak 2012-05-07 14:58:02 UTC
Created attachment 10532 [details]
gs 9.05 rendered file processed by convert Version: ImageMagick 6.7.5-7 2012-03-07 Q16

convert -depth 8 -width 422 after_gs.jpeg after_convert.jpeg
Comment 6 Rob Lanphier 2012-05-08 00:53:20 UTC
This issue will get resolved by bug 36623 (upgrade to Precise).  We could ask that the image scalers cut in line.
Comment 7 Nemo 2012-10-26 20:58:07 UTC
We're now on 9.05 as the error in bug 23652 comment 4 shows.

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


Navigation
Links