Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • In File pdf-thumbnails/pdf-thumbnails.php

    search for function pdf_thumbnails_admin_int() and use following changes:

    function pdf_thumbnails_admin_int()
    {
    //if (!extension_loaded(‘imagick’)) {
    // add_action(‘admin_notices’, ‘pdf_thumbnails_missing_imagick’);
    // return;
    //}
    add_filter(‘wp_generate_attachment_metadata’, ‘pdf_thumbnails_generate_attachment_metadata’, 10, 2);
    add_action(‘deleted_post’, ‘pdf_thumbnails_deleted_post’);
    }

    In file pdf-thumbnails/PdfThumbnailsPlugin.php

    search for function getThumbnailBlob($filename) and use following changes:

    private function getThumbnailBlob($filename)
    {
    $blob = apply_filters(‘pdf_thumbnails_generate_image_blob’, null, $filename);
    if ($blob) {
    return $blob;
    }
    /*
    $imagick = new Imagick($filename);
    $imagick->setIteratorIndex(0);
    $imagick->setImageFormat(‘jpg’);
    return $imagick->getImageBlob();
    */

    $arrPathInfo = pathinfo($filename);
    $strFilename = $arrPathInfo[“filename”];
    $strFilenameOut = “./” . $strFilename . “-pdf-image.jpg”;
    exec(“convert $filename”.”[0]”.” $strFilenameOut”);
    $strReturn = file_get_contents($strFilenameOut);
    unlink($strFilenameOut);
    return $strReturn;
    }

    Hi Stianlik,

    because I needed it for a project I implemented it dirty so far …

    After disabling extension-check I replaced Imagick-Routine with:

    $arrPathInfo = pathinfo($filename);
    $strFilename = $arrPathInfo[“filename”];
    $strFilenameOut = “userdefinedpath/” . $strFilename . “-pdf-image.jpg”;
    exec(“convert $filename”.”[0]”.” $strFilenameOut”);
    $strReturn = file_get_contents($strFilenameOut);
    unlink($strFilenameOut);
    return $strReturn;

    • This reply was modified 2 years, 10 months ago by linuxpinguin. Reason: Deleting thumbnailimage
Viewing 2 replies - 1 through 2 (of 2 total)