Page MenuHomePhabricator

Switch from GhostScript to MuPDF for thumbnailing PDFs
Open, LowPublic

Description

On #ghostscript, Robin_Watts suggested using MuPDF for thumbnailing:

<Robin_Watts> mupdf is optimised for screen output, so may be a better bet for what you need. [10:02]


Version: unspecified
Severity: normal
URL: http://www.mupdf.com/

Details

Reference
bz36594
Related Gerrit Patches:
mediawiki/extensions/PdfHandler : masterPdfhandler: Switch from Ghostscript to MUPDF

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:28 AM
bzimport set Reference to bz36594.
bzimport added a subscriber: Unknown Object (MLST).
brion added a comment.Sep 29 2013, 3:16 PM

For reference:

http://www.mupdf.com/ is a little light on info, but code is under AGPL license.

Default build appears to create a command-line app 'mudraw' as well as the GUI viewer:

$ ./build/debug/mudraw
usage: mudraw [options] input [pages]
-o - output filename (%d for page number)
-F - output format (if no -F, -o will be examined)

		supported formats: pgm, ppm, pam, png, pbm, tga

-p - password
-r - resolution in dpi (default: 72)
-w - width (in pixels) (maximum width if -r is specified)
-h - height (in pixels) (maximum height if -r is specified)
-f - fit width and/or height exactly (ignore aspect)
-c - colorspace {mono,gray,grayalpha,rgb,rgba}
-b - number of bits of antialiasing (0 to 8)
-B - maximum bandheight (pgm, ppm, pam output only)
-g render in grayscale
-m show timing information
-M show memory use summary
-t show text (-tt for xml, -ttt for more verbose xml)
-x show display list
-d disable use of display list
-5 show md5 checksums
-R - rotate clockwise by given number of degrees
-G - gamma correct output
-I invert output
-l print outline
-j - Output mujstest file
-i ignore errors and continue with the next file
pages comma separated list of ranges

Sounds like it wouldn't be hard to support as a replacement or supplement to gs.

Aklapper lowered the priority of this task from Medium to Low.Aug 31 2015, 8:18 AM
Aklapper updated the task description. (Show Details)
Aklapper set Security to None.
Aklapper removed a subscriber: wikibugs-l-list.
Restricted Application added subscribers: Matanya, Aklapper. · View Herald TranscriptAug 31 2015, 8:18 AM
Jdforrester-WMF moved this task from Untriaged to Backlog on the Multimedia board.Sep 4 2015, 6:14 PM
Aklapper renamed this task from Switch to MuPDF for thumbnailing PDFs to Switch from GhostScript to MuPDF for thumbnailing PDFs.Mar 1 2017, 2:07 PM
Rammanojpotla added a subscriber: Rammanojpotla.EditedSep 15 2017, 12:22 PM

Iam trying solving it,basically it mean changing the value of "PdfProcessor" in extension .json and also in Localsettings.php the value of $wgPdfProcessor from gs to that of mupdf and changing the commands to be executed in the terminal by $cmd in PdfHandler_body.php has to be changed from gs to that of mupdf so that it executes the commands related to that of mupdf through which it displays the thumbnails in same pdf format using mupdf as it's dependency instead of Ghostscript Am I right please correct it it is?

Where is the address to the -sOutputFile=- is given as ings command no adress is given?

@Rammanojpotla: I unfortunately have problems to read and understand the last comments. What is "ings" in "is given as ings command no address"?
In general, using proper punctuation is very welcome to structure comments - this helps avoiding misunderstandings. Thanks!

Sorry for the mistake it is actually not "Ings" it is "in gs". The comment above is " in the command which ghostscript executes to render the images -sOutputFile=- gives the name to the rendered image hence so they are placed in /images/thumb directory but I could not get where the value of output file is given" can you say where actually the value the sOutputfile is given ?

@Aklapper if the patch has been submitted in gerrit then the documentation at https://www.mediawiki.org/wiki/Extension:PdfHandler would it be updated as that of mupdf?

Change 379573 had a related patch set uploaded (by Rammanojpotla; owner: Rammanoj):
[mediawiki/extensions/PdfHandler@master] Switched from GhostScript to MuPDF for thumbnailing PDFs

https://gerrit.wikimedia.org/r/379573

@Aklapper if the patch has been submitted in gerrit then the documentation at https://www.mediawiki.org/wiki/Extension:PdfHandler would it be updated as that of mupdf?

It's more than welcome to update documentation. :) (There is no need to ping me specifically, as other people can also answer such questions.)

can anyone say about the typos that could be updated for this issue I couldn't find them ?

@Rammanojpotla: I don't understand... Where were "typos" mentioned before? Please elaborate and see T38594#3617527 - thanks!

@Aklapper you have left a comment in gerrit page of the typos of dependency, So I asked if there are any ,are you referring to documentation page of extension pfhandler ?

If you refer to a comment on Gerrit you likely want to reply on Gerrit. So everybody involved can actually see the context. :)

can anyone review the patch it had been a long time since it had been submitted and no one reviewed it?