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

WordPress Trac noreply at wordpress.org
Wed Oct 26 04:31:50 UTC 2016


#31050: Better PDF Upload Management
-------------------------------------+---------------------------
 Reporter:  celloexpressions         |       Owner:  mikeschroder
     Type:  feature request          |      Status:  assigned
 Priority:  normal                   |   Milestone:  4.7
Component:  Media                    |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  ui
-------------------------------------+---------------------------
Changes (by joemcgill):

 * keywords:  has-patch needs-unit-tests needs-testing => has-patch needs-
     testing


Comment:

 Replying to [comment:94 mikeschroder]:

 > This was done to make the thumbnail size more useful. By disabling crop
 for the thumbnail size, this makes the entire page visible, and avoids
 cropping out of the middle of a page (which allows visible headers in the
 thumbnail).

 It's probably better the way you had it. [attachment:31050.6.diff] reverts
 back to disabling crop for thumbnails.

 > This was caused by the removal of the bits in `image_downsize()` that
 replaced the PDF's filename with the "full image" filename.
 >
 > I've restored these in the [attachment:31050.5.diff most recent patch],
 but am definitely open to a different or cleaner way of doing it.

 Ah, I had missed that when `image_get_intermediate_size()` fails, we
 needed to set fallback data. Looks good to me.

 > I'm not opposed to pulling [the `attachment_fallback_mimetypes` filter]
 for now, and adding it back if there is a call for it.

 Let's do that for now. [attachment:31050.6.diff] removes the filter. I'm
 ok to add it back if we have a need for it but would rather not get stuck
 with back-compat issues if we find we needed the filter to work
 differently.

 > Great to hear! I noticed that the 'full' size is still in there. I've
 been assuming you want to see it pulled before a commit, rather than
 standardize on it, but want to be sure we're on the same page here since
 there's a bit of doing to do so. :)

 The more I think about it, the more I'm coming around to the idea of
 keeping the `full` size data in the `sizes` array.

 I've added a unit test for `wp_generate_attachment_metadata()` to show
 that it should generate image sizes for PDFs. We could certainly do with
 more tests here, but it's a start. You'll need to add the [attachment
 :wordpress-gsoc-flyer.pdf] file from this ticket to your
 `/tests/phpunit/data/images/` directory to get this test to pass.

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


More information about the wp-trac mailing list