[wp-trac] [WordPress Trac] #31050: Better PDF Upload Management

WordPress Trac noreply at wordpress.org
Fri Sep 2 15:11:41 UTC 2016


#31050: Better PDF Upload Management
-------------------------------------------------+-------------------------
 Reporter:  celloexpressions                     |       Owner:
     Type:  feature request                      |  markoheijnen
 Priority:  normal                               |      Status:  assigned
Component:  Media                                |   Milestone:  4.7
 Severity:  normal                               |     Version:
 Keywords:  has-patch dev-feedback needs-unit-   |  Resolution:
  tests needs-testing                            |     Focuses:  ui
-------------------------------------------------+-------------------------

Comment (by joyously):

 Replying to [comment:35 dglingren]:
 > I added PDF thumbnail generation to my plugin, [Media Library
 Assistant](https://wordpress.org/support/plugin/media-library-assistant),
 a while back. It supports dynamic generation in the `[mla_gallery]`
 shortcode. It also has a bulk action in the Media/Assistant admin submenu
 to generate thumbnails and store them as separate Media Library items. You
 are welcome to incorporate any of the code or ideas in Core.
 >
 > I also discovered that adding "Featured Image" support to Media Library
 items is easy and works well:
 >
 > `add_post_type_support( 'attachment', 'thumbnail' );`
 >
 > Once that's done you can assign an image to any non-image item (PDF,
 audio, video, Office documents) and use it in gallery displays, etc. It's
 a nice alternative to generating thumbnails.

 Using the post_thumbnail seems like it would be the WordPress way to do
 things, as attachments are just posts anyway, and it applies to all non-
 image types instead of just PDFs. Then it's just a matter of generating it
 on upload, and maybe marking it so the image is not displayed separately
 in the Media Library (or not).

 My opinion for generating the already uploaded ones is that it should only
 happen when used, as in while displaying the thumbnails in Media Library,
 the PDF is next, get the thumbnail but if it doesn't exist, create it. It
 seems to me that all image sizes should be done that way instead of
 littering the server with unused image sizes. (There's a plugin that does
 this: Dynamic Image Resizer.)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31050#comment:55>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list