Make WordPress Core

Opened 8 years ago

Closed 6 weeks ago

#39630 closed defect (bug) (fixed)

PDF Thumbnails in Media Library Don't Fall Back to Full Size

Reported by: daleharrison's profile daleharrison Owned by: antpb's profile antpb
Milestone: 6.7 Priority: normal
Severity: normal Version: 4.7
Component: Media Keywords: has-patch
Focuses: ui, administration Cc:

Description

When previewing uploaded files in the Media Library, image thumbnails fall back to displaying the full size image when the option medium_size_h is set to 0 (the 0 setting is used to stop WordPress generating thumbs at that size).

The same functionality does not work for uploaded PDFs, instead displaying wp-includes/images/media/document.png in their place. The full-size thumbnail is generated, but not used.

The Attachment Details modal window successfully falls back to the full size image when previewing a PDF under the same circumstances.

Attachments (3)

Screen Shot 2017-01-18 at 12.47.17 PM.png (92.7 KB) - added by daleharrison 8 years ago.
Example of PDF Thumbnail Compared to Image Thumbnails in Media Library
39630.diff (1.0 KB) - added by kushang78 8 months ago.
Added patch for this ticket.
Screenshot from 2024-06-13 17-45-38.png (264.7 KB) - added by mai21 4 months ago.
pdf in media library

Download all attachments as: .zip

Change History (41)

@daleharrison
8 years ago

Example of PDF Thumbnail Compared to Image Thumbnails in Media Library

This ticket was mentioned in Slack in #core-media by joemcgill. View the logs.


8 years ago

This ticket was mentioned in Slack in #core-media by joedolson. View the logs.


2 years ago

#3 @joedolson
2 years ago

  • Milestone changed from Awaiting Review to 6.2
  • Owner set to joedolson
  • Status changed from new to accepted

#4 @antpb
2 years ago

This was discussed in a recent Media component meeting and we suspect that the fallback just needs one more step between medium and default pdf icon to include the full thumb after no medium found.

This ticket was mentioned in Slack in #core-media by joedolson. View the logs.


2 years ago

#6 @antpb
2 years ago

  • Owner changed from joedolson to antpb
  • Status changed from accepted to assigned

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


20 months ago

#8 @mukesh27
20 months ago

This ticket was discussed during the recent bug scrub. It looks like it's unlikely that work will be done on this during the 6.2 cycle.

@antpb Is this still possible to land in 6.2, or should it be moved to Future Release for now?

#9 @mukesh27
20 months ago

  • Keywords needs-patch added

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


20 months ago

#11 @joedolson
20 months ago

  • Milestone changed from 6.2 to 6.3

Moving this to 6.3; @antpb hasn't had the time to tackle it during this cycle, but we still think this should be fixed soon.

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


17 months ago

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


16 months ago

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


16 months ago

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


15 months ago

#16 @oglekler
15 months ago

  • Milestone changed from 6.3 to 6.4

This ticket was discussed during bug scrub and due to lack of patch it was decided to move it out of the current 6.3 milestone. Seeing that @antpb wrote that working on it, I am moving this to 6.4.

Ad props to @mukesh27

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


15 months ago

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


14 months ago

#19 @nicolefurlan
13 months ago

Noting here that @antpb confirmed a few weeks ago that this would be addressed for 6.4. We're ~2 weeks from RC1 so just let us know if that is unlikely to happen by then.

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


12 months ago

#21 @antpb
12 months ago

  • Milestone changed from 6.4 to 6.5

I'm still pending a patch on this one and need to move to 6.5

@kushang78
8 months ago

Added patch for this ticket.

#22 @kushang78
8 months ago

  • Keywords has-patch added; needs-patch removed

Successfully included the full thumb after no medium found. Please check the attached patch file.

Thanks!

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


8 months ago

#24 @swissspidy
8 months ago

@antpb Just checking in, is this still on your radar for 6.5?

#25 @swissspidy
8 months ago

  • Milestone changed from 6.5 to 6.6

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


5 months ago

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


4 months ago

#28 @hmbashar
4 months ago

  • Keywords needs-testing added

#29 @mai21
4 months ago

  • Keywords needs-testing-info added

@daleharrison Thanks for reporting the issue.

Just confirming the problem, is it in displaying pdf/audio file name here /wp-admin/upload.php?mode=grid?

@mai21
4 months ago

pdf in media library

This ticket was mentioned in Slack in #core-test by mai21. View the logs.


4 months ago

#31 @daleharrison
4 months ago

@mai21 Correct, I observed this in the grid view

#32 @sudipatel007
4 months ago

Test Report


Description

Patch has been tested and it is working as expected.
Now PDF Thumbnails is appeared in Media Library.

Environment

  • WordPress: 6.6-beta3-58440-src
  • PHP: 8.1.23
  • Server: nginx/1.16.0
  • Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.23)
  • Browser: Chrome 126.0.0.0 (macOS)
  • Theme: Twenty Nineteen 2.8

Test Results

Now PDF Thumbnails is appeared in Media Library.

Screenshot - https://prnt.sc/Gw-lwpKt_tv8

#33 @sudipatel007
4 months ago

  • Keywords needs-testing needs-testing-info removed

This ticket was mentioned in Slack in #core by nhrrob. View the logs.


4 months ago

#35 @audrasjb
4 months ago

  • Milestone changed from 6.6 to 6.7

As per today's bug scrub, we're going to move this ticket to 6.7. It's pretty close to resolution but we're also close to 6.6 RC1 and it wasn't committed yet.

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


2 months ago

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


6 weeks ago

#38 @antpb
6 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 58947:

Media: Implement fallback to full-size thumbnails for PDFs in Media Library.

When medium-size thumbnails are disabled, PDF previews in the Media Library grid view now fall back to displaying full-size thumbnails instead of a generic document icon.

Props daleharrison, kushang78, mukesh27, sudipatel007, mai21, antpb.
Fixes #39630.

Note: See TracTickets for help on using tickets.