stianlik
Forum Replies Created
-
Forum: Plugins
In reply to: [PDF Thumbnails] ACF Front End EditorHi,
You can run the generation function manually using pdf_thumbnails_generate_attachment_metadata. E.g.
function gen_thumb($post_ID){ $attachmentId = get_field( "file_upload", $post_ID); pdf_thumbnails_generate_attachment_metadata(null, $attachmentId); } add_action( 'publish_post', 'gen_thumb');
Note that this function is not part of the official PDF Thumbnails API so it may change in the future.
EDIT: Changed
$post_ID
toattachmentId
in sample.Forum: Plugins
In reply to: [PDF Thumbnails] How to install Ghostscript and ImageMagik on Bluehost?I answered the issue about a smaller thumbnail in your other thread. In short, you can specify one of your pre-configured sizes as argument two when using
get_the_post_thumbnails
, e.g. with a size defined assmall
, you callget_the_post_thumbnail($post, 'small);
to get the image.The reasy why you’re getting 12 different jpg-files are that your WordPress-installation is configured with 11 different thumbnail sizes (see the codex on post thumbnails. Each time you upload a PDF, the plugin does the following:
1. Generate and save one new image
2. Save information about that image as a normal attachmentStep 2 makes WordPress generate thumbnails in different sizes based on your configuration. This is the same thing that happens when you upload a normal image.
Forum: Plugins
In reply to: [PDF Thumbnails] How to implement PDF thumbnailSeems like you have figured out most the details on your own ??
You can simplify your code using wp_get_attachment_url instead of
get_attached_file
to get the URL directly.The size can be modified as follows:
1. Register thumbnail size (e.g.
my-small-size
) using add_image_size (unless the built-in WordPress sizes suit your needs: ‘thumb’, ‘thumbnail’, ‘medium’, ‘large’, ‘post-thumbnail’)2. Change
$image = get_the_post_thumbnail($post);
into$image = get_the_post_thumbnail($post, 'my-small-size');
Forum: Plugins
In reply to: [PDF Thumbnails] How to install Ghostscript and ImageMagik on Bluehost?No problem ?? It looks like you have the required packages installed. Do you have any problems with the plugin?
Forum: Plugins
In reply to: [PDF Thumbnails] HTTP ErrorJust tested with another PDF file and it worked!
Still, that’s odd. Any ideia why it works with some files and not others?It’s hard to say, most likely some of the libraries (imagemagick or ghostscript) have problems reading the file for some reason, maybe some advanced features are in use? Can you send me the PDF-file for testing?
Forum: Plugins
In reply to: [PDF Thumbnails] How to install Ghostscript and ImageMagik on Bluehost?If you are using shared hosting you need to convince the owners of the server. You can check your settings by creating a template-file containing
<?php phpinfo(); ?>
and view it in your browser. It should contain information about imagick and supported file file types for your server.Forum: Plugins
In reply to: [PDF Thumbnails] ImageMagick already installedAre you still getting the same error? Did you follow the installation instructions?
I have not used Centos personally, but you need three packages: ImageMagick, Ghostscript, and PHP extension for ImageMagick. I found some instructions that may be of help here. Quickly summarized, you should run the following commands:
yum install php-pear yum install ImageMagick* pecl install Imagick
Forum: Plugins
In reply to: [PDF Thumbnails] Gallery with thumbnails linking to PDF filesNine months since last update, marking this as resolved.
Forum: Plugins
In reply to: [PDF Thumbnails] HTTP ErrorHaven’t heard anything in six months, marking this as resolved.
Forum: Plugins
In reply to: [PDF Thumbnails] Thumbnail for several PDF not workingNo response in two months, marking this a as resolved.
Forum: Plugins
In reply to: [PDF Thumbnails] ghostscript library problemUnfortunately, yes. Ghostscript provides imagick with the ability to read pdfs.
Forum: Plugins
In reply to: [PDF Thumbnails] Amazon S3At the moment, this plugin simply hooks onto WordPress when an attachment is saved and generate a thumbnail if the mediatype is ‘application/pdf’. The core functionality is provided by a call to Imagick, where the PDF is read using readimage().
I don’t have any experience with S3 or WP FileBase Pro, but it may be possible with some integration. It really depends on what you want to achieve. If you give me a more detailed use case, I can try to give you a better answer.
Forum: Plugins
In reply to: [PDF Thumbnails] Thumbnail for several PDF not workingIt should work on most (all) PDFs, but you may run into problems with big PDF files if you have a server that limits script execution time.
Can you tell me more about the PDFs files you have problems with? Are they different from PDFs that you successfully generate thumbnails for? How large are the PDFs (disk usage, MB)?
It would helpful if you could paste an excerpt of your web servers error log in this thread.
I don’t see any mention of the imagick extension in the information you posted so it looks like you have the same problem. Your hosting provider needs to install imagick with ghostscript support.
The reason you are seeing the error message is that the plugin checks your system to detect if you have the required dependency before generating images. It is not possible to use this plugin without imagick installed and activated for PHP.
Forum: Plugins
In reply to: [PDF Thumbnails] CMYK PDF thumbnail saturation problemI have not run into this issue myself (not been using PDFs with CMYK colors), but I will try to point you to the right direction. Since the results are good on Chrome, I suspect that Internet Explorer has problems rendering images with CMYK colors. To circumvent the problem, you may be able to convert the images into another colorspace, i.e. RGB.
You can replace the image generation code using the plugin API. From there you should be able to transform the images into the RGB colorspace using imagick.transformimagecolorspace.