Skip to content

Conversation

@peterwilsoncc
Copy link
Contributor

@peterwilsoncc peterwilsoncc commented Nov 7, 2024

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.

Includes tests from #7733 but modified to use HEIC for the conversion source.

Trac ticket: Core-62359

@github-actions
Copy link

github-actions bot commented Nov 7, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props mukesh27, peterwilsoncc, azaozz, apermo, flixos90, ironprogrammer.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link

github-actions bot commented Nov 8, 2024

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Copy link

@apermo apermo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one WPCS issue.

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peterwilsoncc This looks great to me, thanks for working on this.

I have one question, but I trust the tests passing over my question, so I'll already approve.

@azaozz
Copy link
Contributor

azaozz commented Nov 8, 2024

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/or converted images have the -1 suffix.

Copy link
Member

@ironprogrammer ironprogrammer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @peterwilsoncc! Just a couple quick nits here.

Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @peterwilsoncc ♥️

peterwilsoncc and others added 2 commits November 10, 2024 08:37
Co-authored-by: Brian Alexander <824344+ironprogrammer@users.noreply.github.com>
Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit-pick. Not blocking add end period in message.

Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
@peterwilsoncc
Copy link
Contributor Author

Merged r59379 / e1f052e

Thanks all for helping get this over the line.

@peterwilsoncc peterwilsoncc deleted the fix/62359-no-dimension-suffix-converted-img-type branch November 10, 2024 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants