WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.53k stars 4.21k forks source link

`FormFileUpload`: Prevent HEIC and HEIF files from always being uploaded on Safari #67139

Closed cbravobernal closed 2 days ago

cbravobernal commented 2 days ago

What?

One fix could be reverting this commit c5921d766c143ef6774c827c8c2f6322b2b26b6b.

Adding this compatibility is causing the bug reported in https://core.trac.wordpress.org/ticket/62447

The bug reports that uploading a transparent PNG by using the upload button on a Safari browser is renaming the filename and removing the transparent background.

We can make it conditional for non Safari browsers only.

Testing Instructions

Image: charmander

In Chrome or Firefox, create a group, set a background color, upload a block image and use the upload button to upload you're transparent PNG. Check on the frontend that the image uploaded is a transparent PNG.

Do the same in Safari. Check on the frontend that the image uploaded is a transparent PNG.

Screenshots or screencast

Screenshot 2024-11-19 at 21 53 50 Screenshot 2024-11-19 at 21 54 21
github-actions[bot] commented 2 days ago

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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: cbravobernal <cbravobernal@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: azaozz <azaozz@git.wordpress.org>
Co-authored-by: desrosj <desrosj@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>

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

cbravobernal commented 2 days ago

Cherry-picked to wp/6.7 for a minor release.