Forum Replies Created

Viewing 15 replies - 121 through 135 (of 177 total)
  • Plugin Author Mizuho Ogino

    (@fishpie)

    Error 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.

    Plugin Author Mizuho Ogino

    (@fishpie)

    Write 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' );
    }
    Plugin Author Mizuho Ogino

    (@fishpie)

    the functions.php in the theme which you are using.

    Plugin Author Mizuho Ogino

    (@fishpie)

    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.

    Plugin Author Mizuho Ogino

    (@fishpie)

    Hi, 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?

    Plugin Author Mizuho Ogino

    (@fishpie)

    I updated to 1.3.8 and add the filter.

    Plugin Author Mizuho Ogino

    (@fishpie)

    Hi.

    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.

    Plugin Author Mizuho Ogino

    (@fishpie)

    Hi 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.

    Plugin Author Mizuho Ogino

    (@fishpie)

    I updated the plugin to 1.3.7 and add filter lines.
    Thank you.

    Plugin Author Mizuho Ogino

    (@fishpie)

    Hi cbisin

    I’ve not set the error message :”Imagick PDF support is not enabled.”
    You might have misunderstood with other plugins.

    Plugin Author Mizuho Ogino

    (@fishpie)

    Hi!
    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.

    Plugin Author Mizuho Ogino

    (@fishpie)

    Thank you for sharing useful information!

    Plugin Author Mizuho Ogino

    (@fishpie)

    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.)

    Plugin Author Mizuho Ogino

    (@fishpie)

    Can you tell me the code that’s output by the editor?

    Plugin Author Mizuho Ogino

    (@fishpie)

    Happy holidays.

    Did you select “attachment page” or “none” instead of “PDF Media File” in “Link To” selector?

Viewing 15 replies - 121 through 135 (of 177 total)