Make WordPress Core

Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#62359 closed defect (bug) (fixed)

Converted images have the dimension suffix added to the full size image.

Reported by: peterwilsoncc's profile peterwilsoncc Owned by: peterwilsoncc's profile peterwilsoncc
Milestone: 6.7 Priority: normal
Severity: normal Version: 6.7
Component: Media Keywords: has-patch has-unit-tests reporter-feedback commit
Focuses: Cc:

Description

When an image format is auto converted to a web safe file type, the full size image of the converted file is given the dimensions suffix. Eg peggy.heic will become peggy-1000x750.jpeg.

To avoid confusion, it would be preferable if the image either had no suffix, eg peggy.jpeg or a suffix to indicate it has been converted, eg peggy-converted.jpeg. My preference is for the former.

I've put this on the 6.7 milestone for resolution as once WP 6.7 is released, back-compat requirements kick in and the dimension suffix would need to be retained.

As discussed with @flixos90 and @mukesh27 on PR#7733.

Attachments (1)

peggy.heic (259.1 KB) - added by peterwilsoncc 3 weeks ago.
Test HEIC image of a cat wishing its human would leave it alone.

Download all attachments as: .zip

Change History (15)

@peterwilsoncc
3 weeks ago

Test HEIC image of a cat wishing its human would leave it alone.

This ticket was mentioned in PR #7748 on WordPress/wordpress-develop by @peterwilsoncc.


3 weeks ago
#1

  • Keywords has-patch added

Remove the dimension suffix from the full size image when converted to a web safe type.

This prevents the full size image file names from having the same form as a sub-sized image, filename-widthxheight.ext. Instead the file name uses the original name with the new extension.

Trac ticket: Core-62359

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


3 weeks ago

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


3 weeks ago

#4 @ironprogrammer
3 weeks ago

  • Keywords has-unit-tests added

Thanks for the ticket, PR, and sample image, @peterwilsoncc!

Test Report

Patch tested: https://github.com/WordPress/wordpress-develop/pull/7748

Environment

  • Hardware: MacBook Pro Apple M1 Pro
  • OS: macOS 14.6.1
  • Browser: Safari 17.6
  • Server: nginx/1.27.2
  • PHP: 8.2.25, ImageMagick support
  • MySQL: 8.0.27
  • WordPress: 6.8-alpha-59274-src

Actual Results

  • ✅ Converted image was saved with the new extension, without the dimensions suffix (-{widthx}x{height}).
  • ✅ Image exceeding the big image threshold was saved with the -scaled filename suffix (not affected by this patch).

Supplemental Artifacts

Uploading adorable sample image before (peggy.heic) and after (peggy-1.heic) applying patch:

https://cldup.com/UnDE4zSQBE-3000x3000.png

@azaozz commented on PR #7748:


3 weeks ago
#5

Just tested this again (manually) and all seems to work properly.

  • The name of the originally uploaded HEIC image is preserved after converting it, only the extension is different.
  • If a file with the target name already exists, the name of the uploaded image is properly incremented. I.e. if image.jpg already exists in the uploads directory, and the user uploads image.heic, the latter is saved as image-1.heic, and all resulting sub-sizes and converted images have the -1 suffix.

#6 @azaozz
3 weeks ago

  • Keywords commit added

Seems good to commit and backport to 6.7.

#7 @peterwilsoncc
3 weeks ago

  • Owner set to peterwilsoncc
  • Resolution set to fixed
  • Status changed from new to closed

In 59379:

Media: Remove dimension suffix from full size converted HEIC images.

Removes the dimension suffix, eg -1000x1000 from the file name of full size images automatically converted from HEIC to JPEGs by WordPress. Introduces unit tests for the default conversion of images and customized conversion settings via the image_editor_output_format filter.

Follow up to [58849], [58942], [59317], [59346], [59366]

Props mukesh27, peterwilsoncc, azaozz, apermo, flixos90, ironprogrammer.
Fixes #62359.
See #53645, #62305.

#9 @peterwilsoncc
3 weeks ago

  • Keywords dev-feedback added; commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 6.7 backport consideration following another committers signoff.

#10 @peterwilsoncc
3 weeks ago

In 59380:

Media: Include image update missed in [59379].

"We missed you", hissed the lovecats.
-- The Cure.

See #62359.

#11 @davidbaumwald
3 weeks ago

  • Keywords reporter-feedback commit added; dev-feedback removed

Working on backporting these now for RC5.

#12 @davidbaumwald
3 weeks ago

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

In 59381:

Media: Remove dimension suffix from full size converted HEIC images.

Removes the dimension suffix, eg -1000x1000 from the file name of full size images automatically converted from HEIC to JPEGs by WordPress. Introduces unit tests for the default conversion of images and customized conversion settings via the image_editor_output_format filter.

Follow up to [58849], [58942], [59317], [59346], [59366].

Reviewed by davidbaumwald.
Merges [59379] and [59380] to the 6.7 branch.

Props mukesh27, peterwilsoncc, azaozz, apermo, flixos90, ironprogrammer.
Fixes #62359.
See #53645, #62305.

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


3 weeks ago

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


3 weeks ago

Note: See TracTickets for help on using tickets.