Opened 4 hours ago
Last modified 22 minutes ago
#64593 new defect (bug)
allow PDF preview generation without sizes
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 6.9.1 |
| Component: | Media | Keywords: | 2nd-opinion needs-patch |
| Focuses: | administration | Cc: |
Description
Currently when we upload a pdf, it generates PDF preview with different thumbnail and sizes. However when we disable the additional media sizes to 0 in settings > Media. The PDF previews no longer get generated.
The idea is to remove dependency on media sizes to generate the pdf preview. In Library we already get full size for a pdf. file-name.pdf have file-name-pdf.jpg
Steps:
- Upload a pdf in Media Library /wp-admin/upload.php
Result - Pdf preview get generated with all enabled sizes.
- Disable cropping/additional thumbnail sizes in Settings > Media by setting the value 0x0.
Result - PDF preview shows an icon /wp-includes/images/media/document.svg
Expectation:
Uploading pdf generate the default full size preview which we see in Library without even if other media sizes are disabled.
Attachments (2)
Change History (4)
Note: See
TracTickets for help on using
tickets.
I agree that the missing PDF previews are a real issue and should be addressed. However, this ticket also highlights a more general question about how WordPress decides whether media previews and other derived files should be created.
At the moment, setting image sizes to 0 is commonly used to effectively turn off thumbnail generation. This behavior is widely relied upon, but it is not clearly defined and ends up influencing things that users would not necessarily expect, such as PDF previews.
From a user and product perspective, image dimensions describe the size of images, not whether previews or other media representations should exist at all. Still, changing the behavior of 0 is not an option, as many sites depend on it today.
Instead of fixing PDF previews in isolation, it may be worth discussing a more general and explicit way to decide when derived media files should be created, while keeping the current behavior for existing sites fully intact.