Announcement

Collapse
No announcement yet.

PDF - Thumbs with ImageMagick and Ghostscript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PDF - Thumbs with ImageMagick and Ghostscript

    ImageMagick6 ist installed and working
    Ghostscript is installed and working

    Code:
    convert \test.pdf \test.jpg 2>&1
    shellscript is working..

    PHP Code:
    $im = new Imagick();
    $im->readimage('/test.pdf[0]');
    $im->setImageFormat('jpeg');    
    $im->writeImage('/thumb.jpg');
    $im->clear();
    $im->destroy(); 
    PHP is working...


    I think, there is no need for delegate.xml because shell and PHP are working. Anyway, inserted:

    Code:
     <delegate decode="pdf" encode"jpg"  command="&quot;convert %i %o&quot;"/>

    Anyway, getting error in admincp:
    Failed to automatically validate that Ghostscript is installed & configured with ImageMagick for PDF to JPG conversion.
    Please ensure that Ghostscript is installed and that relevant entries in ImageMagick's delegates.xml point to the proper path for Ghostscript's executable. You can ignore this and set this option to "Yes" if PDF conversion already works without the delegates check.

    Ignoring this has no effect.

    Uploading images - thumbs are createt.
    uploading pdf - thumb not and also no error...

    Is this feature working? What is wrong?

    P.S. tryed with VB 5.3.3 RC2
    Last edited by AScherff; Fri 15th Sep '17, 2:43am. Reason: P.S.

  • #2
    Your delegate command should actually call Ghostscript. If it isn't on the PATH checked by the server, you would need the path in the command. However, if it works in the shell script, it may be configured during compile so try without the explicit delegate.

    Code:
    <delegate decode="pdf" encode"jpg"  command="gs &quot;convert %i %o&quot;"/>
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment


    • #3
      stil not working for me - but

      in /atachments i can see hat a .thumb file is created and it is a jpg-file but in a very,very poor quality - even when the delegate is not set.

      I can dig into, if you give me a hint where the thumb is created. I think somewhere in in /core/vb/image/imagemagick.php ?

      Comment


      • #4
        Offhand, I don't know where it is set in the code.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API - Full / Mobile
        Vote for your favorite feature requests and the bugs you want to see fixed.

        Comment


        • #5
          Hmmm, an old one but I have just come across this.

          I can open a shell command and I can find the Imagmagick and GS working fine. I opened a support ticket to see if I can have the host look into this as it seems to be working from shell, just not within vb5.6.1

          Is there anything I can change within vB to work around this, I am sure the answer is no but I ask anyway.



          Thanks In Advance

          John

          Comment


          • #6
            Is Ghostscript available in the path or do you need to traverse to its location to us it?
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API - Full / Mobile
            Vote for your favorite feature requests and the bugs you want to see fixed.

            Comment


            • #7
              Wayne

              The error to me is stating it cannot find GS or unable to use it. So i queried my host on this and the reply is below.

              I have checked the server settings in detail and unfortunately I could not find the reason for this error. Imagick and Ghostscript are working fine and I could not see any errors in the logs. The following delegates are currently included in the ImageMagick installation

              [[email protected]:/root]$ convert -list configure | grep DELEGATES
              DELEGATES bzlib mpeg freetype gslib jng jpeg lcms lzma openexr pango png tiff wmf x xml zlib
              DELEGATES bzlib freetype gslib jng jpeg lcms ltdl lzma openexr png ps tiff wmf x xml zlib

              Could you please check this with the vbulletin support regarding this issue? Without a specific error message or the exact command that the script is using, we are unable to resolve the problem from our end. So please check with them and let us know if the script requires any changes in the server setting to make it work correctly.


              I have checked the server settings in detail and unfortunately I could not find the reason for this error. Imagick and Ghostscript are working fine and I could not see any errors in the logs. The following delegates are currently included in the ImageMagick installation

              [[email protected]:/root]$ convert -list configure | grep DELEGATES
              DELEGATES bzlib mpeg freetype gslib jng jpeg lcms lzma openexr pango png tiff wmf x xml zlib
              DELEGATES bzlib freetype gslib jng jpeg lcms ltdl lzma openexr png ps tiff wmf x xml zlib

              Could you please check this with the vbulletin support regarding this issue? Without a specific error message or the exact command that the script is using, we are unable to resolve the problem from our end. So please check with them and let us know if the script requires any changes in the server setting to make it work correctly.


              So I am back to you guys Wayne, can you enquire as to the exact command being executed for the PDF to JPG conversion so I can pass it on.

              There is no errors when I enable Imagmagick and its 6.9x (I seen the other thread on 7)

              Only error is when i set PDF to JPG to Yes and i see this.

              Error Failed to automatically validate that Ghostscript is installed & configured with ImageMagick for PDF to JPG conversion. Please ensure that Ghostscript is installed and that relevant entries in ImageMagick's delegates.xml point to the proper path for Ghostscript's executable. You can ignore this and set this option to "Yes" if PDF conversion already works without the delegates check.

              John
              Thanks In Advance

              John

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...
              X