Last modified: 2012-10-24 19:22:24 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 T39632, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37632 - Thumbnail generation broken on 1.19
Thumbnail generation broken on 1.19
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
PdfHandler (Other open bugs)
REL1_19-branch
PC Linux
: Unprioritized major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-15 17:00 UTC by Adrian Siemieniak
Modified: 2012-10-24 19:22 UTC (History)
2 users (show)

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


Attachments

Description Adrian Siemieniak 2012-06-15 17:00:21 UTC
Hi,
I've skipped 1.18 - so I'm not sure if it was working or not with this release. On MW 1.19 PdfHandler does not generates thumbnail with generic error code 1 ("GPL Ghostscript 9.05: Unrecoverable error, exit code 1").

It seems like GS does not get proper file name to convert, since it's URL file format. For example: mwstore://local-backend/local-public/9/9f/FreeLoaderManual-ocr.pdf

Changing this code fixes problem (I haven't seen in MW 1.19 any information about changes in file api)

--- PdfHandler_body.php 2012-06-15 18:50:21.574756245 +0200
+++ PdfHandler_body.php-orig    2012-06-15 18:50:04.247514269 +0200
@@ -103,8 +103,7 @@
 
                $width = $params['width'];
                $height = $params['height'];
-               $srcPath = $image->getLocalRefPath();
+               $srcPath = $image->getPath();
                $page = $params['page'];
 
                if ( $page > $this->pageCount( $image ) ) {

Cheers! Adrian
Comment 1 Roger Appleby 2012-06-16 13:21:30 UTC
I also get this error using 1-19 but can confirm it worked in 1-18.

details in my case are;

•	Error creating thumbnail: GPL Ghostscript 9.05: Unrecoverable error, exit code 1
convert: no decode delegate for this image format `/tmp/magick-XXBtkyN5' @ constitute.c/ReadImage/503.
convert: missing an image filename `/tmp/transform_5454eaa-1.jpg' @ convert.c/ConvertImageCommand/2822.

Regards

Roger Appleby
Comment 2 Adrian Siemieniak 2012-06-16 23:43:46 UTC
> --- PdfHandler_body.php 2012-06-15 18:50:21.574756245 +0200
> +++ PdfHandler_body.php-orig    2012-06-15 18:50:04.247514269 +0200
> @@ -103,8 +103,7 @@
> 
>                 $width = $params['width'];
>                 $height = $params['height'];
> -               $srcPath = $image->getLocalRefPath();
> +               $srcPath = $image->getPath();
>                 $page = $params['page'];
> 
>                 if ( $page > $this->pageCount( $image ) ) {
> 
> Cheers! Adrian

I've just saw my mistake ;) - patch should be other way around

--- PdfHandler_body.php 2012-06-15 18:50:21.574756245 +0200
+++ PdfHandler_body.php-orig    2012-06-15 18:50:04.247514269 +0200
@@ -103,8 +103,7 @@

                $width = $params['width'];
                $height = $params['height'];
-               $srcPath = $image->getPath();
+               $srcPath = $image->getLocalRefPath();
                $page = $params['page'];

                if ( $page > $this->pageCount( $image ) ) {
Comment 3 Roger Appleby 2012-06-17 05:40:48 UTC
Just made the change and it works fine.

Thanks

Roger A
Comment 5 Andre Klapper 2012-10-24 19:22:24 UTC
Thank you Bugzilla for garbling my comment. Sigh.
Next try with fake spaces:
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/PdfHandler.git;a=patch; h=da2c37465ff61035c37c9f5c35bb66eaef093a8e; hp=d999b09e729effe226ee44996c7ca5101e31eaed

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


Navigation
Links