Make WordPress Core

Opened 12 months ago

Last modified 6 months ago

#59740 new defect (bug)

Image scaling being applied inconsistently

Reported by: whistlerdan's profile whistlerdan Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

My understanding was that images over 2560px would be scaled and a "-scaled" named version created.

This doesn't happen every time, though. What exactly are the criteria?

It doesn't happen for me on some larger images over 8000px wide. But does then happen on smaller 5000px images.

I have created many test images of different sizes, and I cannot figure out what is causing this discrepancy. Some get scaled, and some do not. And it doesn't appear to be related to pixel dimension.

If there is something more than the pixel dimension being used to determine whether a scaled version is created, where is the documentation to explain this?

Change History (3)

#1 @sabernhardt
12 months ago

  • Component changed from General to Media

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


6 months ago

#3 @antpb
6 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Hi @whistlerdan ! Thanks for this ticket. This ticket was reviewed in the recent Media component meeting and we think what you are experiencing is the server being out of memory at the time of the scaling which could be a variable occurrence depending on the current load of the server when the task initiates.

I did some digging and found that this logic in current state intentionally fails silently and continues on the upload process. See https://github.com/WordPress/wordpress-develop/blob/a26c655f852887168d67200a98769c3aa6ffe2e8/src/wp-admin/includes/image.php#L312-L331

I'm changing this issue to focus on adding the errors so folks understand better when a failure to make -scaled happens.

@swissspidy this might interest you and your recent browser processing hacks. I cant imagine a browser would struggle as a fallback to process large images like this. 🤔

Note: See TracTickets for help on using tickets.