Thumbnails won’t load
-
Hi, unfortunately, some of the PDFs on my site doesn’t have a thumbnail while other PDFs have. This happens to all new files which are uploaded.
The website uses imagick 7.0.7 and Ghostscript 8.70
-
This topic was modified 5 years, 7 months ago by
patriceis.
The page I need help with: [log in to see the link]
-
This topic was modified 5 years, 7 months ago by
-
Thanks for your report. I regret the problem you are having with PDF thumbnails.
You wrote “This happens to all new files which are uploaded.” Thumbnail generation for PDF documents is a core WordPress function that does not involve MLA. My experience has been that the process works well in general but on some sites and some files it will fail.
I went to your site and found two documents without thumbnails on the “Start/Downloads/Faktenbl?tter” page: SiCab 15 MiniPOP and SiCab 18 OutdoorPOP. I downloaded these and added them to my test system. Both generated thumbnails without any errors.
MLA contains a feature to generate PDF thumbnails in WordPress format. There is a workaround you can try in this earlier topic:
PDF thumbnail generation fails with error message
You can try re-generating thumbnails using the MLA feature. If that doesn’t work I can work with you to investigate further. Post an update here with any additional information you can provide. Thanks for your interest in the plugin.
Alright, I tried to regenerate the PDFs of those two files without thumbnail. I just checked the PHP Info and it seems like the imagick module doesn’t support PDF filetype. I just contacted the server provider to see if they can help me.
ERROR: Item 1598, thumbnail generation failed - Image load exception: NoDecodeDelegateForThisImageFormat
PDF’ @ error/constitute.c/ReadImage/501
ERROR: Item 1596, thumbnail generation failed – Image load exception: NoDecodeDelegateForThisImageFormatPDF' @ error/constitute.c/ReadImage/501
Thanks for your help so far. ??
Alright, so we used PHP FPM before which doesn’t seem to work with imagick.
We now use PHP CGI 7.2 but unfortunately, the site just gives an error 500 if I want to regenerate the thumbnails.
When I select more than one file to regenerate the thumbnail it won’t give an error 500 and the plugin will tell me that it was successful but unfortunately the thumbnails are still not generated.
Thanks for your updates. It looks like you are having trouble getting your site/server configured properly for the WordPress and MLA thumbnail generation features.
I don’t see any mention of Ghostscript in your updates; this is a key component for success. You can check your configuration by navigating to the Settings/Media Library Assistant Shortcodes tab and scrolling down to the “Thumbnail Substitution Support, mla_viewer” section. If you see something like “WARNING: MLA Viewer support may not be available:” followed by “Ghostscript support is not installed.” or “Imagick support is not installed.”, there’s a configuration problem. You will have to work with your hosting provider to resolve the problems.
You can find more information about the configuration requirements and some installation suggestions in these earlier topics:
Problem and suggestion regarding thumbnails (from pdf) and Ghostscript
If the above suggestions do not work and the trouble persists, you can try looking for more details in the error log, and you can activate some MLA debugging logic to give you more information as described in this earlier topic:
pdf thumbnails not generated php7.0
I hope the above suggestions are useful and thanks in advance for any additional information you can provide.
Sorry, Ghostscript is also installed (Version 8.70). In the PHP-Info the imagick module lists PDF as a supported file type.
The same WordPress configuration/installation is also installed on another server (demo system) where the image generation is working fine.
I activated the MLA debug now and it gives me the following:
[15-Jul-2019 06:15:47 UTC] 600 MLACore::mla_plugins_loaded_action() MLA 2.79 () mla_debug_level 0xF [15-Jul-2019 06:15:58 UTC] 600 MLACore::mla_plugins_loaded_action() MLA 2.79 () mla_debug_level 0xF [15-Jul-2019 06:16:02 UTC] 299 MLA_WPML::mla_list_table_bulk_action_initial_request( mla-generate-featured-image ) request = array ( 's' => '', 'mla_search_fields' => array ( 0 => 'title', 1 => 'excerpt', 2 => 'content', 3 => 'file', ), 'mla_search_connector' => 'AND', 'page' => 'mla-menu', 'lang' => 'de', '_wpnonce' => 'b8dffe8449', '_wp_http_referer' => '/wp-admin/upload.php?page=mla-menu', 'action' => 'mla-generate-featured-image', 'm' => '0', 'mla_filter_term' => '0', 'paged' => '1', 'mla_thumbnail_options' => array ( 'width' => '', 'height' => '', 'page' => '', 'resolution' => '', 'quality' => '', 'type' => 'WordPress', 'existing_thumbnails' => 'delete', 'suffix' => '-Thumbnail', ), 'mla-generate-thumbnail' => 'Generate Thumbnails', 'screen' => 'media_page_mla-menu', 'cb_attachment' => array ( 0 => '1922', ), 'action2' => '-1', 'woof_parse_query' => 1, 'tax_input' => array ( ), 'mla_bulk_action_do_cleanup' => true, ) [15-Jul-2019 06:16:02 UTC] 1275 MLA::mla_process_bulk_action request = array ( 's' => '', 'mla_search_fields' => array ( 0 => 'title', 1 => 'excerpt', 2 => 'content', 3 => 'file', ), 'mla_search_connector' => 'AND', 'page' => 'mla-menu', 'lang' => 'de', '_wpnonce' => 'b8dffe8449', '_wp_http_referer' => '/wp-admin/upload.php?page=mla-menu', 'action' => 'mla-generate-featured-image', 'm' => '0', 'mla_filter_term' => '0', 'paged' => '1', 'mla_thumbnail_options' => array ( 'width' => '', 'height' => '', 'page' => '', 'resolution' => '', 'quality' => '', 'type' => 'WordPress', 'existing_thumbnails' => 'delete', 'suffix' => '-Thumbnail', ), 'mla-generate-thumbnail' => 'Generate Thumbnails', 'screen' => 'media_page_mla-menu', 'cb_attachment' => array ( 0 => '1922', ), 'action2' => '-1', 'woof_parse_query' => 1, 'tax_input' => array ( ), 'mla_bulk_action_do_cleanup' => true, ) [15-Jul-2019 06:16:02 UTC] 358 MLA_WPML::mla_list_table_bulk_action_item_request( 1922 ) request = array ( 's' => '', 'mla_search_fields' => array ( 0 => 'title', 1 => 'excerpt', 2 => 'content', 3 => 'file', ), 'mla_search_connector' => 'AND', 'page' => 'mla-menu', 'lang' => 'de', '_wpnonce' => 'b8dffe8449', '_wp_http_referer' => '/wp-admin/upload.php?page=mla-menu', 'action' => 'mla-generate-featured-image', 'm' => '0', 'mla_filter_term' => '0', 'paged' => '1', 'mla_thumbnail_options' => array ( 'width' => '', 'height' => '', 'page' => '', 'resolution' => '', 'quality' => '', 'type' => 'WordPress', 'existing_thumbnails' => 'delete', 'suffix' => '-Thumbnail', ), 'mla-generate-thumbnail' => 'Generate Thumbnails', 'screen' => 'media_page_mla-menu', 'cb_attachment' => array ( 0 => '1922', ), 'action2' => '-1', 'woof_parse_query' => 1, 'tax_input' => array ( ), 'mla_bulk_action_do_cleanup' => true, ) [15-Jul-2019 06:16:02 UTC] 376 MLA_WPML::bulk_action_item_request( mla-generate-featured-image, 1922 ) $request['tax_input'] = array ( ) [15-Jul-2019 06:16:02 UTC] 384 MLA_WPML::bulk_action_item_request( mla-generate-featured-image, 1922 ) $request['tax_action'] NOT SET [15-Jul-2019 06:16:02 UTC] 1454 MLA::mla_process_bulk_action returning page_content = array ( 'message' => 'ERROR: Item 1922, thumbnail generation failed - Image load exception: Failed to read the file<br>', 'body' => '', 'unchanged' => 0, 'success' => 0, 'failure' => 1, 'item_results' => array ( 1922 => array ( 'result' => 'failure', 'message' => 'ERROR: Item 1922, thumbnail generation failed - Image load exception: Failed to read the file', ), ), ) [15-Jul-2019 06:16:07 UTC] 600 MLACore::mla_plugins_loaded_action() MLA 2.79 () mla_debug_level 0xF [15-Jul-2019 06:16:10 UTC] 299 MLA_WPML::mla_list_table_bulk_action_initial_request( mla-generate-featured-image ) request = array ( 's' => '', 'mla_search_fields' => array ( 0 => 'title', 1 => 'excerpt', 2 => 'content', 3 => 'file', ), 'mla_search_connector' => 'AND', 'page' => 'mla-menu', 'lang' => 'de', '_wpnonce' => 'b8dffe8449', '_wp_http_referer' => '/wp-admin/upload.php?page=mla-menu', 'action' => 'mla-generate-featured-image', 'm' => '0', 'mla_filter_term' => '0', 'paged' => '1', 'mla_thumbnail_options' => array ( 'width' => '', 'height' => '', 'page' => '', 'resolution' => '', 'quality' => '', 'type' => 'WordPress', 'existing_thumbnails' => 'delete', 'suffix' => '-Thumbnail', ), 'mla-generate-thumbnail' => 'Generate Thumbnails', 'screen' => 'media_page_mla-menu', 'cb_attachment' => array ( 0 => '1922', ), 'action2' => '-1', 'woof_parse_query' => 1, 'tax_input' => array ( ), 'mla_bulk_action_do_cleanup' => true, ) [15-Jul-2019 06:16:10 UTC] 1275 MLA::mla_process_bulk_action request = array ( 's' => '', 'mla_search_fields' => array ( 0 => 'title', 1 => 'excerpt', 2 => 'content', 3 => 'file', ), 'mla_search_connector' => 'AND', 'page' => 'mla-menu', 'lang' => 'de', '_wpnonce' => 'b8dffe8449', '_wp_http_referer' => '/wp-admin/upload.php?page=mla-menu', 'action' => 'mla-generate-featured-image', 'm' => '0', 'mla_filter_term' => '0', 'paged' => '1', 'mla_thumbnail_options' => array ( 'width' => '', 'height' => '', 'page' => '', 'resolution' => '', 'quality' => '', 'type' => 'WordPress', 'existing_thumbnails' => 'delete', 'suffix' => '-Thumbnail', ), 'mla-generate-thumbnail' => 'Generate Thumbnails', 'screen' => 'media_page_mla-menu', 'cb_attachment' => array ( 0 => '1922', ), 'action2' => '-1', 'woof_parse_query' => 1, 'tax_input' => array ( ), 'mla_bulk_action_do_cleanup' => true, ) [15-Jul-2019 06:16:10 UTC] 358 MLA_WPML::mla_list_table_bulk_action_item_request( 1922 ) request = array ( 's' => '', 'mla_search_fields' => array ( 0 => 'title', 1 => 'excerpt', 2 => 'content', 3 => 'file', ), 'mla_search_connector' => 'AND', 'page' => 'mla-menu', 'lang' => 'de', '_wpnonce' => 'b8dffe8449', '_wp_http_referer' => '/wp-admin/upload.php?page=mla-menu', 'action' => 'mla-generate-featured-image', 'm' => '0', 'mla_filter_term' => '0', 'paged' => '1', 'mla_thumbnail_options' => array ( 'width' => '', 'height' => '', 'page' => '', 'resolution' => '', 'quality' => '', 'type' => 'WordPress', 'existing_thumbnails' => 'delete', 'suffix' => '-Thumbnail', ), 'mla-generate-thumbnail' => 'Generate Thumbnails', 'screen' => 'media_page_mla-menu', 'cb_attachment' => array ( 0 => '1922', ), 'action2' => '-1', 'woof_parse_query' => 1, 'tax_input' => array ( ), 'mla_bulk_action_do_cleanup' => true, ) [15-Jul-2019 06:16:10 UTC] 376 MLA_WPML::bulk_action_item_request( mla-generate-featured-image, 1922 ) $request['tax_input'] = array ( ) [15-Jul-2019 06:16:10 UTC] 384 MLA_WPML::bulk_action_item_request( mla-generate-featured-image, 1922 ) $request['tax_action'] NOT SET [15-Jul-2019 06:16:10 UTC] 1454 MLA::mla_process_bulk_action returning page_content = array ( 'message' => 'ERROR: Item 1922, thumbnail generation failed - Image load exception: Failed to read the file<br>', 'body' => '', 'unchanged' => 0, 'success' => 0, 'failure' => 1, 'item_results' => array ( 1922 => array ( 'result' => 'failure', 'message' => 'ERROR: Item 1922, thumbnail generation failed - Image load exception: Failed to read the file', ), ), ) [15-Jul-2019 06:16:16 UTC] 600 MLACore::mla_plugins_loaded_action() MLA 2.79 () mla_debug_level 0xF [15-Jul-2019 06:21:42 UTC] 600 MLACore::mla_plugins_loaded_action() MLA 2.79 () mla_debug_level 0xF [15-Jul-2019 06:22:36 UTC] 600 MLACore::mla_plugins_loaded_action() MLA 2.79 () mla_debug_level 0xF
-
This reply was modified 5 years, 7 months ago by
patriceis.
Thanks for taking the time to set up the debug log and produce the debugging information, and thanks for your patience while I was travelling.
I believe the “Failed to read the file” message is coming from Imagick/Ghostscript and suggests a configuration problem on your server. I can produce an updated MLA Development Version with more precise logging, but it looks like the problem is not caused by an MLA issue. As far as I can tell, MLA is finding the PDF file and passing it along to Imagick/Ghostscript for processing.
I did find these similar reports and suggested fixes:
Imagick don’t open pdf files with “Failed to read the file” exception
Solved: PHP Imagick ‘unable to open image’ PDF
Perhaps you or your server support team can use the information there to make some progress.
I will work on more precise error reporting in MLA’s debug logging, but I don’t think it will help too much. Let me know if the above suggestions are useful.
Unfortunately, the solutions didn’t work.
We just tried to change the type of the WP image generation to JPG and PNG and it worked perfectly with both of them. It seems like the WP image generation type isn’t working for us.
Thanks for your update; I regret that the other topics I found were not helpful.
You wrote “We just tried to change the type of the WP image generation to JPG and PNG and it worked perfectly with both of them.” I understand that to mean that you used MLA’s Thumbnail bulk action and set the “Type” radio button to “JPG” and “PNG”; is that right? If so, I understand that both of these options were able to generate new Media Library items with the appropriate images, right?
I will look more closely at the code and see what difference might account for the “WP” option failures. Let me know if I’ve understood your post correctly.
Yep, exactly. PNG and JPG options works, WP option doesn’t.
I have run experiments and taken a closer look at my code and WordPress code. I am no closer to understanding the cause of your issue, but I have added some code to MLA that might give me more information.
I have uploaded a new MLA Development Version dated 20190707 that contains the improved code. You can find step-by-step instructions for using the Development Version in this earlier topic:
PHP Warning on media upload with Polylang
It would be great if you could install the Development Version, re-run your tests and post the log information for my analysis. Try generating a WordPress thumbnail, and also try generating a JPG version. Thanks for your patience and your help.
I have released MLA version 2.80, which includes the improved logging code referred to above.
It would be great if you could install the latest version, re-run your tests and post the log information for my analysis. Try generating a WordPress thumbnail, and also try generating a JPG version. Thanks for your patience and your help.
I have a new MLA Development Version with some fixes developed for this similar topic:
Error thrown when generating WP thumb for PDF
As I wrote earlier, I would be very interested in more information about the failing MLA thumbnail generation. Using the new Development Version would be best, but even the 2.80 version might give me more information. Thanks for any additional information you can provide.
It has been a month since my last post. I hope you have found a solution for your problem with generating WP thumbnails for your PDF documents.
I am marking this topic resolved, but please update it if you have any additional problems or information regarding this issue.
-
This reply was modified 5 years, 7 months ago by
- The topic ‘Thumbnails won’t load’ is closed to new replies.