• Resolved lennonrich

    (@lennonrich-1)


    Hello,

    When I try to upload PDFs, I get an “httperror” message on the right-hand pane and the document doesn’t show in the library until you close the media library and re-enter, and it’s also stopped generating thumbnails. Other media types, such as JPG and PNG work fine, but PDFs just won’t generate properly.

    I’m not sure what info you’ll need in order to help me diagnose the issues we’re experiencing, but any help anyone’s able to give would be gratefully received ??

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Mizuho Ogino

    (@fishpie)

    Hi lennonrich

    Thank you for your feedback.

    I think HTTPerror problem is 90% in file size, RAM memory, and not failing Imagick library.
    Have you tested to upload smaller one?
    If it works, Increase values in php.ini, for example:

    memory_limit = 64M
    upload_max_filesize = 64M
    post_max_size = 64M

    And add the following code to wp-config.php:

    define(‘WP_MEMORY_LIMIT’, ’64M’)

    If your server has not enough memory, try uncheck “Customize Generated Image properties” in the options setting page of the plugin.

    Thread Starter lennonrich

    (@lennonrich-1)

    Hello,

    Firstly, many thanks for your help so far.

    Tried to upload a 5kb PDF and still getting the error, even after applying those fixes. The PHP config is:

    memory_limit = 256M
    upload_max_filesize = 32M
    post_max_size = 32M

    For reference, this is the error we’re getting:
    Hosted on Imgur

    This is the size of the PDF file we’re trying to update:
    Hosted on Imgur

    And if you close the media browser and then re-open it, the file is there, albeit without a thumbnail:
    Hosted in Imgur

    Could this be a permissions issue on the host?

    Thanks in advance!

    Plugin Author Mizuho Ogino

    (@fishpie)

    Thanks for giving it a try!

    Can you check the wp-content/debug.log file for errors?
    If you don’t have it, please add the following to your site’s wp-config.php file.

    define('WP_DEBUG', true);
    if ( WP_DEBUG ) {
    	define('WP_DEBUG_LOG', true);
    	define('WP_DEBUG_DISPLAY', false);
    	@ini_set('display_errors',0);
    }

    And let me know what you findings.

    Thread Starter lennonrich

    (@lennonrich-1)

    Hiya,

    So this is the error message:

    [12-Apr-2016 08:11:27 UTC] PHP Fatal error: Call to undefined method Imagick::setImageAlphaChannel() in /home/bathandnortheast/public_html/assets/plugins/pdf-image-generator/pdf-image-generator.php on line 276

    I then tried it with a different PDF, just to test:
    [12-Apr-2016 08:17:01 UTC] PHP Fatal error: Call to undefined method Imagick::setImageAlphaChannel() in /home/bathandnortheast/public_html/assets/plugins/pdf-image-generator/pdf-image-generator.php on line 276

    However, ImageMagick is definitely installed on the server:
    Hosted on Imgur

    Could it be because our wp-content directory has been renamed ‘assets’ for security?

    Many thanks again for your assistance!

    Plugin Author Mizuho Ogino

    (@fishpie)

    Thanks for reporting, it really helps!

    setImageAlphaChannel() requires imageMagick 6.3.8 or newer.
    I think your ImageMagick version is older than the required minimum.

    I uploaded the Development version 1.4.0b.
    This version verify imageMagick version and separate process.

    https://downloads.www.ads-software.com/plugin/pdf-image-generator.zip

    I couldn’t test it in my server because it is difficult to make the same environment with you.
    So, please test it and let me know whether it works.

    Thank you!

    Thread Starter lennonrich

    (@lennonrich-1)

    Hiya,

    Thanks for the update! Tried with the new version and tested with three different PDFs with no success:

    [12-Apr-2016 12:50:45 UTC] PHP Fatal error: Call to undefined method Imagick::setImageAlphaChannel() in /home/bathandnortheast/public_html/assets/plugins/pdf-image-generator/pdf-image-generator.php on line 293

    [12-Apr-2016 12:50:56 UTC] PHP Fatal error: Call to undefined method Imagick::setImageAlphaChannel() in /home/bathandnortheast/public_html/assets/plugins/pdf-image-generator/pdf-image-generator.php on line 293

    [12-Apr-2016 12:51:07 UTC] PHP Fatal error: Call to undefined method Imagick::setImageAlphaChannel() in /home/bathandnortheast/public_html/assets/plugins/pdf-image-generator/pdf-image-generator.php on line 293

    I’ve also put in a request to the host to update ImageMagick to the latest version.

    Thanks so much for your help ??

    Plugin Author Mizuho Ogino

    (@fishpie)

    Sorry, I forgot to notice that you need to re-activate the plugin after uploading.
    Could you try again?

    Thread Starter lennonrich

    (@lennonrich-1)

    Hiya,

    Here’ what I did:

    • Deleted the existing plugin
    • Uploaded the new plugin
    • Deactivated the plugin
    • Reactivated the plugin
    • Went into Options, unchecked using custom dimensions and saved
    • Uploaded a PDF

    Unfortunately it still fails, with the message:

    [12-Apr-2016 13:05:52 UTC] PHP Fatal error: Call to undefined method Imagick::setImageAlphaChannel() in /home/bathandnortheast/public_html/assets/plugins/pdf-image-generator/pdf-image-generator.php on line 293

    Thanks!

    Plugin Author Mizuho Ogino

    (@fishpie)

    Hmm. The result is different from what I was expecting.

    Could you tell me what version is your imagick is?

    Please paste in the functions.php.

    if ( is_user_logged_in () ){
    $v = Imagick::getVersion();
    preg_match('/ImageMagick ([0-9]+\.[0-9]+\.[0-9]+)/', $v['versionString'], $v);
    echo 'imagick version: '.$v[1];
    }

    Thread Starter lennonrich

    (@lennonrich-1)

    Modified ever so slightly:

    if ( is_user_logged_in () ){
    $v = Imagick::getVersion();
    preg_match('/ImageMagick ([0-9]+\.[0-9]+\.[0-9]+)/', $v['versionString'], $v);
    echo '<!--imagick version: '.$v[1] . '-->';
    }

    Produces:
    <!--imagick version: 6.2.8-->

    Plugin Author Mizuho Ogino

    (@fishpie)

    I’m sorry.
    That was just because of my miscoding.
    Try 1.4.1c.

    https://downloads.www.ads-software.com/plugin/pdf-image-generator.zip

    Thread Starter lennonrich

    (@lennonrich-1)

    Hello ??

    [12-Apr-2016 14:15:12 UTC] PHP Strict Standards: Non-static method Imagick::getversion() should not be called statically in /home/bathandnortheast/public_html/assets/themes/ccg/functions.php on line 618

    Edit:Further, the media library’s stopped working in Grid View since this 1.4.1c. It still works in List view, but not Grid view ??

    Plugin Author Mizuho Ogino

    (@fishpie)

    It slipped my mind ??
    I fixed Strict standards errors.

    Try 1.4.1d.

    https://downloads.www.ads-software.com/plugin/pdf-image-generator.zip

    Edit:
    >the media library’s stopped working in Grid View
    You mean you can’t click “grid view” icon?

    Thread Starter lennonrich

    (@lennonrich-1)

    Hello,

    No problems — I appreciate everything you’re doing ??

    This is with 1.4.1d

    [12-Apr-2016 14:41:21 UTC] PHP Strict Standards: Non-static method Imagick::getversion() should not be called statically in /home/bathandnortheast/public_html/assets/themes/ccg/functions.php on line 618

    Media Library
    When I load up the media library, the loading circle just spins and spins and spins. If I press List View, it all loads in about a second. Click the Grid View button again, just nothing, spinning. This could be entirely coincidental, I just wanted to feed it back in case it helps ??

    Plugin Author Mizuho Ogino

    (@fishpie)

    This PHP Strict Standards error is not because of the plugin. Because of the “Imagick::getVersion();” code you inserted one hour ago.
    Please remove the code from functions.php. Its role is finished.

    Media Library
    I have no clue whether it’s because of HTTP error……

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘HTTP error’ is closed to new replies.