Was a great useful plugin, seems it no longer works in 2023. I have not found a suitable replacement that allows for this. However keep an eye on this issue about handling it in core:
]]>Trying to regenerate my PDF thumbnails with this plugin and the CPU on the server spikes to 100%. The only way out, then, is to restart the whole server (I can’t even get in to restart Apache).
Is there any way to limit how how much CPU it’s using?
Which is better for this? Use imageMagick with exec function or Use imagick PHP Extension
]]>I have this (below) inside a resizable table cell. For records that do NOT have PDFs, the TD is small; for records that DO have PDFs, the TD is larger, to accommodate the Thumbnail.
echo get_the_post_thumbnail ( $post->ID, 'medium' );
The problem is, the thumbnail does not actually render on screen.
Shouldn’t the code above display the attached PDF thumbnail for the current Post?
Mark
]]>Hi, when running the PDF Image Generator for all missing PDF images, there will be generated 8 jpg images of the files, with the same file size, plus the corresponding thumbnails. This is filling up my Database and Disk with lot of duplicated files.
For example the file “my-file.pdf” will generate:
my-file-pdf.jpg
my-file-pdf-1.jpg
my-file-pdf-2.jpg
my-file-pdf-3.jpg
my-file-pdf-4.jpg
my-file-pdf-5.jpg
my-file-pdf-6.jpg
my-file-pdf-7.jpg
my-file-pdf-8.jpg
as well as all the corresponding thumbnails for each of this 8 copy images.
I did not find any setting where I can prevent this. Any clues?
]]>Hi,
Do anyone is experiencing this issue? If in the hosting panel I set PHP 7.3 it work fine , but if I set the stable64 7.4 the plugin stop to generate thumbs.
If is not possible to make this work ,there are more recent similar plugin in alternative?
Thanks
]]>Is anyone else having issues after updating to WordPress 5.3? I noticed that when this plugin is activated, when selecting a featured image for a post, no images show up in the media library. It acts as if there are no images, but if I go to the media library, or deactivate the plugin, all the media are there.
]]>When i click on “Generate Images of PDFs that have no thumbnail” i get a message:
“The image was not GENERATED!!”
Is there already a fix for that?
Or an alternative, what to do to create pdf images, until the plugin is fixed?
Hello everyone! My site was automatically updated to WordPress 4.9.7 and all of the product images and thumbnails, generated by this plugin, now show a broken link placeholder. Some products have images not generated by this plugin and they appear fine.
Broken link placeholder images appear in the Woocommerce product admin area as well as the product admin page. They can be chosen using add featured image, but just show a broken link everywhere in the back end. The images exist and when I download them from the server they appear fine. It’s strange.
Any ideas?
]]>PHP is throwing the following error on PDF upload
ImagickException: Unable to set image alpha channel in /wp-content/plugins/pdf-image-generator/pdf-image-generator.php:384
The solution is to check for an alpha channel before trying to remove it
Change line 380 of pdf-image-generator.php from:
if ( method_exists( 'Imagick','setImageAlphaChannel' ) ) {
to
if ( method_exists( 'Imagick','setImageAlphaChannel' ) && $imagick->getImageAlphaChannel() ) {
Hope this helps!
]]>The plugin has stopped working for all previous links/pdfs.
I can upload the pdf just fine.
– In the media manager I can see the jpg thumbnail of the image on the pdf. This is the jpg that was created. https://assumptionregional.org/wp-content/uploads/2018/03/RAMS-Review-3.13.18-pdf-1-116×150.jpg
– If I go to the post itself and click ADD MEDIA, you cannot see the jpg on the pdf. It shows a generic document png file from the includes folder: https://assumptionregional.org/wp-includes/images/media/document.png
– The live post is blank where the image and link should be, though you can see the code when you inspect the page. When you inspect it, you can see that it cannot find the image. This is the image it is trying to find but it gets a 404: https://assumptionregional.org/wp-content/uploads/2018/03/RAMS-Review-3.13.18-pdf-791×1024.jpg
Something seems wrong. I am also using WordPress 4.9.5 – which the previous commentor noted caused a problem with his site too.
]]>I recently updated to WordPress 4.9.5. Now, when I upload PDF files, the images are no longer generated. If I go into the plugin settings and click “Generate images of PDFs that have no thumbnail”, I receive the following error:
502 Bad Gateway
nginx
We also updated the website to PHP7 at the same time, so unfortunately I do not know the specific cause of the error. Can you please help? Thank you!
]]>When I insert a PDF it just places a link to the PDF, instead of inserting a linked image. What could be wrong?
]]>This plugin is nice. However, I found it slow down the upload a lot.
I tried to upload a 6MB PDF file into wordpress admin page (“Media” -> “Library”) and it took me almost 2min to complete the upload. (It normally took me in few seconds to send out a 6mb file in the same network)
]]>I get this with the latest version:
[13-Jan-2018 12:37:11 UTC] PHP Warning: Illegal string offset 'sizes' in /var/www/html/yyy/wp-content/plugins/image-regenerate-select-crop/image-regenerate-select-crop.php on line 1163
[13-Jan-2018 12:37:11 UTC] PHP Fatal error: Uncaught Error: Cannot use string offset as an array in /var/www/html/yyy/wp-content/plugins/image-regenerate-select-crop/image-regenerate-select-crop.php:1163
Stack trace:
#0 /var/www/html/yyy/wp-content/plugins/image-regenerate-select-crop/image-regenerate-select-crop.php(262): SIRSC_Image_Regenerate_Select_Crop::make_images_if_not_exists(5228, 'thumbnail', 'ct')
#1 /var/www/html/yyy/wp-includes/class-wp-hook.php(286): SIRSC_Image_Regenerate_Select_Crop::process_filtered_attachments(28368, 5228, '_wp_attachment_...', Array)
#2 /var/www/html/yyy/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)
#3 /var/www/html/yyy/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#4 /var/www/html/yyy/wp-includes/meta.php(122): do_action('added_post_meta', 28368, 5228, '_wp_attachment_...', Array)
#5 /var/www/html/yyy/wp-includes/meta.php(202): add_metadata('post', 5228, '_wp_attachment_...', 'a:1:{s:5:"sizes...')
#6 /var/www/html/ in /var/www/html/yyy/wp-content/plugins/image-regenerate-select-crop/image-regenerate-select-crop.php on line 1163
]]>
Hi,
This is a great plugin, but would it be possible to add an option to automatically check for new PDF uploads and generate thumbnails regularly?
Or could you set up a cron job to do this?
This would be great if so.
Thanks.
]]>After I installed the plugin, the Javascript console is throwing a 404 for the file wp-content/plugins/pdf-image-generator/colorPicker.js
. That file is not in the plugin directory anywhere.
Hi there, I have a lot of PDF with 2 or 3 pages. Is it possible to generate all the images and not just the cover?
Thanks for the support and for this awesome plugin
Andrea
Plugin won’t activate.
]]>I see in your docs you give many examples of useful code to query PDF’s and display the Thumbnails etc. I’m particularly interested in the one to get all PDF’s attached and display thumbnails for them:
Does you plugin provide any shortcodes out of the box to do this?
It would be great to just add a shortcode to a page that would render a nice grid of PDF’s thumbnails attached with links to the docs. Ideally with some parameters to tailor grid dimensions, sorting, max items to show, thumbnail sizes etc.
]]>Hi there,
how can I user the filter ‘pigen_filter_convert_imagick’ to convert an PDF in landscape to images in portait.
I need to rotate the images, I think?!
]]>This option does hide the image from the list view, but not from the image side by side view. Is there a setting I’m missing or is this a bug? Thanks.
]]>After I upgrade to 1.5.6, something broken when I upload PDF via WP REST API. The error info is
<b>Warning</b>: Illegal string offset ‘sizes’ in <b>/var/www/html/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php</b> on line <b>348</b><br />
<b>Catchable fatal error</b>: Object of class stdClass could not be converted to string in <b>/var/www/html/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php</b> on line <b>348</b>
I found that you serialize the data of post meta in the hook function pigen_wp_get_attachment_metadata()
:
`
serialize( get_post_meta( $thumbnail_id, ‘_wp_attachment_metadata’, true ) );
`
Then the wp_get_attachment_metadata
no longer return an array, it’s string instead. May I know why you did that?
Hello there,
I don’t want image default link type to be attached to posts image.
Can you please let me know how to restore the default setting to show all media files?
Many thanks
]]>Hi and thanks for this awesome plugin,
However, when I try to upload pdf files higher than 1mo, the thumbnail image looks filtered, which probably means an error in the cmyk conversion to rgb. I use the imageMagick 6.9.6 php extension on a local server, so I don’t believe it’s a server problem…
Is there anyway I can solve this ?
Thanks a lot !
]]>How would you recommend outputting the PDF thumbnail in this situation? I’ve tried your code example but they haven’t worked for me.
<?php
// check if the repeater field has rows of data
if( have_rows('resource_upload') ):
?>
<ul class="resource-feed">
<?php
// loop through the rows of data
while ( have_rows('resource_upload') ) : the_row();
// display a sub field value
$docTitle = get_sub_field('document_title');
$docLink = get_sub_field('document_upload');
?><li>
<a href="<?php echo $docLink; ?>" target="_blank"><div class="thumbnail"></div></a>
<div class="doc-content">
<h2><?php echo $docTitle; ?></h2>
<h3><a href="<?php echo $docLink; ?>" target="_blank">Download</a></h3>
</div>
</li><?php
endwhile;
?>
</ul>
<?php
else : // no rows found
endif;
?>
]]>
Hello,
When i add a PDF from media library in a post using add media button, the generated HTML doesn’t provide a <a>
tag.
In fact only the <img>
tag gets inserted.
Best regards
Hi Mizuho,
maybe I found a little bug. I’m trying to get thumbnails for CMYK PDF files. Your great plugin creates those thumbnails but not with the “-profile” function from imageMagick. So that image colors are not that good. I know your plugin tries to find out if the PDF is in CMYK and then adds the “-profile” part to the convert command. But in your pdf-image-generator.php on line 435 it checks the wrong file:
On line 434 it says:
$get_color = exec( "identify -format '%[colorspace]' {$file_url}", $output, $return );
But the variable “$file_url” isn’t the original pdf file url. It’s the new jpg file url.
The correct code should be:
$get_color = exec( "identify -format '%[colorspace]' {$file}", $output, $return );
Please correct me if I’m wrong.
]]>Hi,
after installing the latest version (1.5.3) I get a ‘HTTP error’ while uploading the PDF in Media Browser.
My WordPress installation content folder is renamed (wp-content → wp-inhalt), maybe that’s the reason?
Hi,
Is there a way to manually input the password for password-protected PDFs during generation?
(using imagick 6.7.7)
]]>Hi, just to let you know, i noticed the thumbnail creation fails if the uploaded PDF filename contains spaces. It also fails if there is a space somewhere in the path to wordpress (which is of course not recommended at all, but it can happens when working on a local server, or a python simplehttpserver for instance).
To correct this problem, a solution can be to use the filter ‘pigen_filter_convert_imageMagick’, parse the command to find where the file paths are, and add single quotes around them.
But the thing is that there is a first command, not filtered (on line 434 in pdf-image-generator.php), used to detect the colorspace of the PDF. So, in case this PDF filename contains spaces, this command will fail anyway.
I would therefore suggest a small update of the plugin, if possible, with just the addition of single quotes directly around file paths in every command used.
Nonetheless, thank you very much for this plugin which is very useful! ??
Benjamin
]]>