Mizuho Ogino
Forum Replies Created
-
Forum: Plugins
In reply to: [PDF Image Generator] Fatal Error on ActivationError code 127 means like php can’t find imageMagick or you don’t have the authority of using the command. I think the best way is to confirm your host again.
Forum: Plugins
In reply to: [PDF Image Generator] Fatal Error on ActivationWrite this code to your functions.php and tel me the output.
if ( is_user_logged_in() ) { exec( 'convert -version', $out, $ver ); print_r($out); echo ' / $ver: '.$ver .' / gs version: '.shell_exec( 'gs --version' ); }
Forum: Plugins
In reply to: [PDF Image Generator] Automate PDF image into custom post type.the functions.php in the theme which you are using.
Forum: Plugins
In reply to: [PDF Image Generator] Automate PDF image into custom post type.Hi.
I hope this function helps you.
//Automatically set PDF thumbnail as featured image. function save_pdf_thumb_as_featuredimage ( $post_id ) { if ( wp_is_post_revision( $post_id ) ) return; if ( get_post_type( $post_id ) !== 'post' ) return; // set your post type if ( get_post_meta( $post_id, '_thumbnail_id', true ) ) return; // post already has featured image $attaches = get_posts ( 'post_parent='.$post_id.'&numberposts=-1&post_type=attachment&post_mime_type=application/pdf&orderby=menu_order&order=ASC' ); if ( $attaches ): foreach( $attaches as $attach ): if ( $thumb_id = get_post_meta( $attach->ID, '_thumbnail_id', true ) ){ // if pdf has thumbnail update_post_meta( $post_id, '_thumbnail_id', $thumb_id ); break; } endforeach; endif; } add_action( 'save_post', 'save_pdf_thumb_as_featuredimage' );
If you want always automatically to set first attachment as featured image even if it is PDF, try this function.
//Automatically set first image/PDF as featured image. function save_thumbnail_as_featuredimage ( $post_id ) { if ( wp_is_post_revision( $post_id ) ) return; if ( get_post_type( $post_id ) !== 'post' ) return; // set your post type if ( get_post_meta( $post_id, '_thumbnail_id', true ) ) return; // post already has featured image $args = array( 'post_parent' => $post_id, 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'orderby' => 'menu_order date', 'order' => 'ASC ASC' ); $attaches = get_posts($args); if ( $attaches ): foreach( $attaches as $attach ): if ( $attach->post_mime_type == 'application/pdf' ){ if ( $thumb_id = get_post_meta( $attach->ID, '_thumbnail_id', true ) ){ // if pdf has thumbnail update_post_meta( $post_id, '_thumbnail_id', $thumb_id ); break; } } elseif ( preg_match("/^image\//", $attach->post_mime_type ) ) { update_post_meta( $post_id, '_thumbnail_id', $attach->ID ); break; } endforeach; endif; } add_action( 'save_post', 'save_thumbnail_as_featuredimage' );
Thank you.
Forum: Plugins
In reply to: [PDF Image Generator] Image quality for large sizeHi, hillaryharris1635.
If the picture are terrible resolution but the text looks fine, there is the possibility of mismatch of the PDF file type with ImageMagick. (A PDF made by some editors sometimes makes mismatch. )
if the whole JPG has terrible resolution, there is the possibility of conflict with other plugins or custom functions.
Could you try upload the same PDF to other websites?
Forum: Plugins
In reply to: [PDF Image Generator] image show in wp-admin/upload.php?mode=listI updated to 1.3.8 and add the filter.
Forum: Plugins
In reply to: [PDF Image Generator] attachment not update on edit post, replace pdfHi.
This error was caused by the option setting of Featured Image. At first, I designed the plugin to allow PDF itself as Featured image. The option hasn’t functioned well since v1.3.6 or older….
Anyway, I updated and clean the options up.On this occasion, I modified behavior of thumbnail on List mode of Media Library, which you report on the other thread.
Thank you.
Forum: Plugins
In reply to: [PDF Image Generator] image show in wp-admin/upload.php?mode=listHi Lee Kung
I know the problem what you said from the first version.
The plugin has no function to replace a mime icon in the static media library page.
Because I thought this update can wait for a later release.I want add it in the future, but now I have no time to code it.
I’m sorry, please wait while more.Thanks.
Forum: Plugins
In reply to: [PDF Image Generator] Feature request: Add filter to $attach_urlI updated the plugin to 1.3.7 and add filter lines.
Thank you.Forum: Plugins
In reply to: [PDF Image Generator] Imagick PDF support is not enabledHi cbisin
I’ve not set the error message :”Imagick PDF support is not enabled.”
You might have misunderstood with other plugins.Forum: Plugins
In reply to: [PDF Image Generator] Feature request: Add filter to $attach_urlHi!
Thanks for useful advice.I updated development version 1.3.7A and add a filter to attachment link.
Please try the fiter, and please tell me it works as you suppose or not.ex.
function pigen_filter_attachment_link ( $html, $attach_id, $attach_url, $attach_output ){ $attach_title = get_the_title( $attach_id ); $html = '<a class="link-to-pdf" href="'.$attach_url.'" rel="attachment wp-att-' .esc_attr($attach_id). '" title="'.esc_attr( $attach_title ).'" target="_blank">' .$attach_output. '</a>'; return $html; }; add_filter( 'pigen_filter_attachment_link', 'pigen_filter_attachment_link', 10, 4 );
I also prepared the filter to the thumbnail output.
ex.function pigen_filter_attachment_output ( $attach_output, $thumbnail_id, $thumbnail, $size, $align ){ $attach_output = '<img src="'. $thumbnail[0] .'" alt="'.get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true ).'" width="'. $thumbnail[1] .'" height="'. $thumbnail[2] .'" class="'.( $align ? 'align' .$align. ' ' : '' ). 'size-' .esc_attr( $size ). ' wp-image-'.$thumbnail_id.'" />'; return $attach_output; }; add_filter( 'pigen_filter_attachment_output', 'pigen_filter_attachment_output', 10, 5 );
https://downloads.www.ads-software.com/plugin/pdf-image-generator.zip
Thank you.Forum: Plugins
In reply to: [PDF Image Generator] solution for imagemagick failure on shared hostingThank you for sharing useful information!
Forum: Plugins
In reply to: [PDF Image Generator] Image not hyperlinking?Pdfs are uploaded OK, images are generated fine, and the html looks perfect. It must be cause of the template or the css. That’s all I can say without seeing the actual website.
(The plugin doesn’t output any JS or CSS to templates.)
Forum: Plugins
In reply to: [PDF Image Generator] Image not hyperlinking?Can you tell me the code that’s output by the editor?
Forum: Plugins
In reply to: [PDF Image Generator] Image not hyperlinking?Happy holidays.
Did you select “attachment page” or “none” instead of “PDF Media File” in “Link To” selector?