Make WordPress Core

Opened 6 years ago

Last modified 5 years ago

#48111 assigned defect (bug)

Update usage of `multi_resize` to utilize new `wp_create_image_subsizes()` function

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

Description

As mentioned in https://core.trac.wordpress.org/ticket/40439#comment:61

There are two uses of multi_resize() that will need to be updated to use the new wp_create_image_subsizes() function introduced in #40439.

Attachments (3)

48111.patch (2.5 KB) - added by progremzion 6 years ago.
48111.2.patch (1.0 KB) - added by azaozz 6 years ago.
48111.3.patch (6.4 KB) - added by kirasong 6 years ago.
48111.2.patch + Automated Test Updates

Download all attachments as: .zip

Change History (20)

#1 @antpb
6 years ago

  • Version set to trunk

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


6 years ago

#3 follow-up: @progremzion
6 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

Hi @antpb

I have fixed the issue. Can you please review? I am new to core contribution, so please do let me know if something is missing.

Thanks!

@progremzion
6 years ago

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


6 years ago

#5 in reply to: ↑ 3 @azaozz
6 years ago

  • Keywords needs-patch added; has-patch needs-testing removed

Replying to progremzion:

Unfortunately 48111.patch doesn't work as expected. We can switch to the new wp_create_image_subsizes() or _wp_make_subsizes() but that may also need handling of PHP fatal errors while processing images.

Also it introduces a regression in _wp_make_subsizes(). It should be able to fall back to $editor->multi_resize() in case a plugin adds another class for processing images that is missing the new make_subsize method.

(Also next time could you make diffs from the root WP dir, the parent of /src).

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


6 years ago

#7 @marybaum
6 years ago

  • Milestone changed from 5.3 to Future Release

Punting -- we're running out of time. If you can commit before RC1, excellent!

#8 @kirasong
6 years ago

  • Milestone changed from Future Release to 5.3

I'd like this in the 5.3 milestone still -- I'll take care of moving it if necessary.

Thanks!

#9 @kirasong
6 years ago

  • Owner set to mikeschroder
  • Status changed from new to assigned

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


6 years ago

@azaozz
6 years ago

#11 @azaozz
6 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

In 48111.2.patch: use the new _wp_make_subsizes() when creating image thumbnails for PDFs (untested).

Unfortunately this is not as straightforward to implement for the image editor. It was designed to "wait" for all operations to complete before it saves all the meta data, including the meta "backup" for previous versions of the image. I'll need a refactoring, best to do in 5.4.

@kirasong
6 years ago

48111.2.patch + Automated Test Updates

#12 @kirasong
6 years ago

@azaozz Thanks so much!

I had been working on this separately and had something very similar, but this covers more cases!

Went ahead and updated the automated tests to account for the change in image generation order.

You'll find 48111.2.patch + those changes in 48111.3.patch.

So far in testing, things are working as expected.

#13 @kirasong
6 years ago

In 46459:

Media: Update fallback previews to support _wp_make_subsizes()

Allows fallback previews (PDF by default, in core) to save image meta
after each size is generated to allow for resuming, and make sizes
immediately available.

Props azaozz, antpb, progremzion, mikeschroder.
See #48111.

#14 @kirasong
6 years ago

  • Keywords needs-patch added; has-patch needs-testing removed
  • Milestone changed from 5.3 to 5.4
  • Type changed from task (blessed) to defect (bug)

Left here is moving the image editor to use _wp_make_subsizes().

I agree this is more complicated and think it's fine to ship with the other parts of WordPress supporting the functionality.

To keep the conversation in the same place, going to move this to 5.4 for consideration, and change it from a task for clarity.

#15 @davidbaumwald
5 years ago

@mikeschroder How do you feel about this ticket for 5.4 given that Beta 3 is a few days away?

#16 @audrasjb
5 years ago

  • Milestone changed from 5.4 to Future Release

Hi,

With 5.4 Beta 3 approaching and the Beta period reserved for bugs introduced during the cycle, this is being moved to Future Release. If any maintainer or committer feels this should be included or wishes to assume ownership during a specific cycle, feel free to update the milestone accordingly.

This ticket was mentioned in Slack in #core-committers by mike. View the logs.


5 years ago

Note: See TracTickets for help on using tickets.