Make WordPress Core


Ignore:
Timestamp:
10/26/2016 07:27:51 AM (8 years ago)
Author:
mikeschroder
Message:

Media: Add support for rendering PDF thumbnails.

When support for PDFs is available, on upload,
render 'Thumbnail', 'Medium', 'Large', and 'Full' sizes of
the first page, and save them in attachment meta.

Use these renders within Add Media, Media Gallery and List views,
Attachment Details, Post/Attachment Edit screens, and Attachment pages.

Support available by default via Imagick -> ImageMagick -> Ghostscript,
but can be provided by any WP_Image_Editor that supports PDFs.

Props adamsilverstein, azaozz, celloexpressions, desrosj, dglingren, ericlewis, ipstenu, joemcgill, joyously, markoheijnen, melchoyce, mikeschroder, tomauger.
Fixes #31050.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/media.php

    r38734 r38949  
    27672767        echo wp_video_shortcode( $attr );
    27682768
    2769     else :
     2769    elseif ( isset( $thumb_url[0] ) ):
     2770
     2771        ?>
     2772        <div class="wp_attachment_image wp-clearfix" id="media-head-<?php echo $attachment_id; ?>">
     2773            <p id="thumbnail-head-<?php echo $attachment_id; ?>">
     2774                <img class="thumbnail" src="<?php echo set_url_scheme( $thumb_url[0] ); ?>" style="max-width:100%" alt="" />
     2775            </p>
     2776        </div>
     2777        <?php
     2778
     2779    else:
    27702780
    27712781        /**
Note: See TracChangeset for help on using the changeset viewer.