We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51020
    • 670 Posts
    Hi All,

    Strange one for you!

    I have a site which has a bunch of PDF downloads.
    Each one has a thumbnail, generated by pThumb.
    I have migrated to a new server - same spec, same version of php, Imagemagick and ghostscript versions are identical between servers, as are PHP extensions.

    But now pThumb no longer generates my thumbnails.
    My server support have reinstalled imageMagick, and I have reinstalled pThumb - but still no joy.

    My call (which worked on the old box) is this:

    <img src="[[pthumb?&input=`[[+tv.PDF]]`&options=`w=300&h=500&zc=1&f=jpg&sfn=0&useResizer=0`]]"/>
    


    Any ideas?

    [ed. note: tm2000 last edited this post 5 years, 3 months ago.]
      • 17301
      • 932 Posts
      Could it be that you have a '-' instead of an '=' in your src attribute?
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 51020
        • 670 Posts
        Quote from: lkfranklin at Nov 30, 2018, 11:34 AM
        Could it be that you have a '-' instead of an '=' in your src attribute?

        Ha ha - sorry no - that as a type when I added it to the forum - the code in the site is correct - good spot though!!
        I've amended my original post now!
          • 17301
          • 932 Posts
          Worth a shot smiley

          Some ideas for debugging:

          • See if [[+tv.PDF]] outputs anything.
          • output [[pthumb?&input=`[[+tv.PDF]]`&options=`w=300&h=500&zc=1&f=jpg&sfn=0&useResizer=0`]] into a paragraph to see what it's printing out and if the domain and path is correct.
          • Check read/write permissions on the folder that its trying to generate images into + check existence
          • Call it uncached.


            ■ email: [email protected] | ■ website: https://alienbuild.uk

            The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
            • 51020
            • 670 Posts
            Quote from: lkfranklin at Nov 30, 2018, 01:47 PM
            Worth a shot smiley

            Some ideas for debugging:

            • See if [[+tv.PDF]] outputs anything.
            • output [[pthumb?&input=`[[+tv.PDF]]`&options=`w=300&h=500&zc=1&f=jpg&sfn=0&useResizer=0`]] into a paragraph to see what it's printing out and if the domain and path is correct.
            • Check read/write permissions on the folder that its trying to generate images into + check existence
            • Call it uncached.



            Thanks.
            I have tried all that unfortunately. In a paragraph it outputs the path to the PDF.
            If I substitute the PDF with a JPG, it outputs a path the the newly sized jpg in the image-cache folder as it should.

            It just doesn't like PDF files.

              • 51020
              • 670 Posts
              In the Error logs It says at the bottom:

              Error messages disabled.

              edit phpThumb.config.php and (temporarily) set
              $PHPTHUMB_CONFIG['disable_debug'] = false;
              to view the details of this error in file "phpthumb.class.php" on line 4148
              [34] => SourceImageToGD() failed in file "phpthumb.class.php" on line 374


              But there is no such file as phpThumb.config.php in my installation - I assume this is just out of date?
              Any ideas?

                • 51020
                • 670 Posts
                UPDATE:
                I've managed to get a more comprehensive error message out:


                [2018-12-03 20:14:03] (ERROR in modProcessor::run @ /home/site/public_html/core/model/modx/modprocessor.class.php : 177) Flat file processor support is deprecated since version 2.7.0.
                [2018-12-03 20:14:25] (ERROR in modTemplateVar::renderInput @ /home/site/public_html/core/model/modx/modtemplatevar.class.php : 396) Old modTemplateVar getRender inputmethod is deprecated since version 2.2.0.
                [2018-12-03 20:14:25] (ERROR in modProcessor::run @ /home/site/public_html/core/model/modx/modprocessor.class.php : 177) Flat file processor support is deprecated since version 2.7.0.
                [2018-12-03 20:14:26] (ERROR in modProcessor::run @ /home/site/public_html/core/model/modx/modprocessor.class.php : 177) Flat file processor support is deprecated since version 2.7.0.
                [2018-12-03 20:14:28] (ERROR in modTemplateVar::renderOutput @ /home/site/public_html/core/model/modx/modtemplatevar.class.php : 288) Old modTemplateVar getRender outputmethod is deprecated since version 2.2.0.
                [2018-12-03 20:14:28] (ERROR @ /home/site/public_html/core/components/phpthumbof/model/phpthumbof.class.php : 156) [pThumb] Resource: 4 || Image: assets/files/downloads/taxi_rate_card.pdf
                Could not cache thumbnail to file at: /home/site/public_html/assets/image-cache/files/downloads/taxi_rate_card.4a5298b7.jpg
                Resizer debug output:
                [0] => Resizer v1.0.1
                [1] => Using GD
                [2] => Input file: assets/files/downloads/taxi_rate_card.pdf
                [3] => Input options:
                'w' => '300',
                'h' => '500',
                'f' => 'jpg',
                'sfn' => '0',
                'useResizer' => '0'
                [4] => *** Error *** Unable to open image assets/files/downloads/taxi_rate_card.pdf
                ----------------------

                Can anyone help?

                Thanks
                Andy
                  • 54796
                  • 5 Posts
                  Have you checked the Imagemagick config?

                  By default on later versions pdf conversion is disabled..

                  Change the line in /etc/ImageMagick-6/policy.xml from

                  <policy domain="coder" rights="none" pattern="PDF" />

                  to

                  <policy domain="coder" rights="read/write" pattern="PDF" />

                  Had the same issue on Ubuntu 18.04 with a clean install for a new project trying to get pthumb working.
                    • 51020
                    • 670 Posts
                    Quote from: kiwichris at Dec 16, 2018, 06:05 AM
                    Have you checked the Imagemagick config?

                    By default on later versions pdf conversion is disabled..

                    Change the line in /etc/ImageMagick-6/policy.xml from

                    <policy domain="coder" rights="none" pattern="PDF">

                    to

                    <policy domain="coder" rights="read/write" pattern="PDF">

                    Had the same issue on Ubuntu 18.04 with a clean install for a new project trying to get pthumb working.</policy></policy>

                    Thanks - I spoke to the host and they aren't keen on customising the install of any software, because it's all controlled by Centos updates. I've had to find a workaround, and manually create the thumbnails in the meantime - annoying that an update would break it.

                    Thanks for the info

                    Andy
                      • 54796
                      • 5 Posts
                      Quote from: tm2000 at Dec 17, 2018, 09:20 AM

                      Thanks - I spoke to the host and they aren't keen on customising the install of any software, because it's all controlled by Centos updates. I've had to find a workaround, and manually create the thumbnails in the meantime - annoying that an update would break it.

                      Arrr, OK... Might be time to look at your own server(s). smiley

                      I moved away from shared hosting providers a few years back after some frustration with getting some custom stuff working under etomite. Etomite, there's a blast from the past. smiley