Automattic / studio

Studio by WordPress.com, a free desktop app that helps developers streamline their local WordPress development workflow.
https://developer.wordpress.com/studio/
GNU General Public License v2.0
175 stars 17 forks source link

I can't upload webp file into Media Library #119

Closed wojtekn closed 1 month ago

wojtekn commented 4 months ago

Quick summary

Users can't upload webp files in Studio. It looks like it doesn't work in https://playground.wordpress.net/, too.

Steps to reproduce

  1. Download webp file from https://developers.google.com/speed/webp/gallery1
  2. Create a site in Studio and open WP Admin
  3. Navigate to Media -> Add New Media File
  4. Drag the downloaded file to upload it

What you expected to happen

The file is uploaded.

What actually happened

Error is displauyed

Screenshot 2024-05-13 at 11 24 28

displayed

Impact

Most (> 50%)

Available workarounds?

Yes, easy to implement

Platform

Mac Silicon

Logs or notes

No response

sejas commented 4 months ago

Currently, there is a workaround to upload webp files: If a user renames the file from .webp to .jpg, then the file uploads correctly and with the correct extension (webp).

This workaround works in Playground and Studio.

Screencast

Here you can see the error and the workaround:

https://github.com/Automattic/studio/assets/779993/0537b06b-2d9a-4dbd-b245-164c630563fd

liviopv commented 4 months ago

📌 REPRODUCTION RESULTS

https://github.com/Automattic/studio/assets/14153300/e3ced420-409c-4e4f-82cc-699874455f78

📌 ACTIONS

derekblank commented 4 months ago

Just following up on this one - it seems like WebP support in Studio would be resolved when the changes from https://github.com/WordPress/wordpress-playground/pull/1393 are published (and the @php-wasm/node dependency can be updated in Studio).

@sejas Does that sound correct? Anything else that can be done to help?

sejas commented 4 months ago

Exactly! That's correct! 👌 If you want, you can ask the Playground team to release a new version. If not, I can do it tomorrow morning. Thanks!

sejas commented 4 months ago

@derekblank , php-wasm/node has been released with v0.7.20 https://www.npmjs.com/package/@php-wasm/node 👍

sejas commented 1 month ago

This has been fixed after updating the playground dependencies: https://github.com/Automattic/studio/pull/491 Kudos to @kozer and @jeroenpf ! 🎉

It will be available in the next Studio release.

I tested trunk, and I've been able to upload a webp image:

Screenshot 2024-09-02 at 14 21 05