Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

55403 - Fix image paths returned from wp_crop_image #2419

Closed
wants to merge 9 commits into from
Closed

55403 - Fix image paths returned from wp_crop_image #2419

wants to merge 9 commits into from

Conversation

lipemat
Copy link

@lipemat lipemat commented Mar 16, 2022

Version 5.8.0 introduced a new image_editor_output_format filter which
allows you to change the output format (extension) of generated image
sizes. If the generated image extension is changed, wp_crop_images must
honor the change and return the correct extension.

Fixes: #55403

Includes: Tests

Trac ticket: https://core.trac.wordpress.org/ticket/55403

Version 5.8.0 introduced a new image_editor_output_format filter which
allows you to change the output format (extension) of generated image
sizes. If the generated image extension is changed, wp_crop_images must
honor the change and return the correct extension.

Fixes: #55403
@github-actions
Copy link

Hi @lipemat! 👋

Thank you for your contribution to WordPress! 💖

It looks like this is your first pull request to wordpress-develop. Here are a few things to be aware of that may help you out!

No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description.

Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making.

More information about how GitHub pull requests can be used to contribute to WordPress can be found in this blog post.

Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook.

If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook.

The Developer Hub also documents the various coding standards that are followed:

Thank you,
The WordPress Project

* upstream/trunk: (215 commits)
  Tests: Add unit tests for rendering in Comment Template block
  REST API: Fix incorrect casing of patterns endpoint schema properties
  Docs: Improve doc blocks for hooks added in [53126].
  Cache API: Improve cache key generation in `WP_Comment_Query`.
  Taxonomy: Only reset non-button form field values after adding a tag.
  Post WordPress 6.0 Beta 1 version bump.
  WordPress 6.0 Beta 1.
  External Libraries: Update polyfill libraries.
  External Libraries: Update some external libraries.
  External Libraries: Update `moment` to version `2.29.2`.
  Media: Fix editing controls covering image edit region.
  Media: Enable edits to custom image sizes.
  Editor: Use block settings to pass assets for the iframed editor
  Administration: Add unit test for term supplementary notice.
  Widgets: Avoid 27 duplicate translations in Media Widgets constructor.
  Editor: Update WordPress packages based based on Gutenberg v13.0 RC3
  Administration: Clarify some sentences after [53131].
  Editor: Remove block patterns from server-generated settings
  REST API: Use snake case convention for field names in Block Patterns
  Tests: Improve test cleanup for block supports
  REST API: Bring new endpoints for Block Patterns from Gutenberg plugin
  Options: Show error when updating all options exceeds `max_input_vars`.
  Emoji: Update the Twemoji to version 14.0.2.
  Media: Run the `wp_content_img_tag` filter once per image.
  I18N: Remove `wp-config.php` file name from translatable strings.
  Formatting: Make `get_the_author_link` pluggable.
  Docs: Misc. docblock fixes in `wp-admin/includes/mic.php`, as per documentation standards.
  Users: Improve wording of the "New Admin Email Address" email.
  Formatting: Avoid escaping valid XML values in `esc_xml()`.
  Build/Test Tools: Update generated CSS files after [53141].
  Editor: Update `build_comment_query_vars_from_block` from Gutenberg
  Build: Bring `caniuse-lite` to the latest version
  Build: Enable React Fast Refresh for block development
  REST API: Fix the wrong name in the comments controller
  Editor: Add changes for new Comments Query Loop blocks
  Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/class-wp-site-icon.php`.
  Administration: Replace "can not" with "cannot" after [53131].
  Build: Update webpack to v5.x
  Administration: Revert unwanted spaces found in `theme.json` after [53131].
  Administration: Revert accidental changes made to `theme.json` in changeset [53131].
  Administration: Replace "can not" with "cannot" after [53131].
  Administration: Remove self-reference ("we") in WordPress Admin.
  Editor: Add missing `defaultDutone` changes
  Editor: Add functionality required for theme export in the site editor
  Tests: Improve code comments for block supports tests
  Permalinks: Improve settings page error messages.
  Posts, Post Types/Taxonomies: Add object type specific registration filters.
  Feeds: Remove comment feed HTML headers when empty.
  Plugins: Update item count when plugin deleted.
  Administration: Remove term page check from `ajax-response.js`.
  ...
Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

I've added a couple of inline suggestions to the tests.

tests/phpunit/tests/image/functions.php Outdated Show resolved Hide resolved
tests/phpunit/tests/image/functions.php Outdated Show resolved Hide resolved
Also remove superfluous `remove_filter`.

Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
@peterwilsoncc
Copy link
Contributor

Thanks for making the code changes.

I made a typo in my suggestion yesterday 🤦 so have pushed a fix to your branch. I merged in trunk so I can ensure the tests are still passing before committing.

@peterwilsoncc
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants