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

Reject .webp inputs #7

Open
fmarier opened this issue Sep 28, 2021 · 3 comments
Open

Reject .webp inputs #7

fmarier opened this issue Sep 28, 2021 · 3 comments

Comments

@fmarier
Copy link

fmarier commented Sep 28, 2021

The ideal workflow for users of this component is:

  1. User uploads a JPEG|GIF|PNG
  2. wasm-thumbnail converts to WEBP

so that we are guaranteed not to host the exact bytes that a user uploaded (i.e. we force a conversion between image formats).

At the moment, the Rust code will accept input images in any of the supported formats.

@tackley
Copy link
Collaborator

tackley commented Oct 6, 2021

Sadly the only rust library I can find that supports writing webp is this one, which is actually a thin wrapper over google's libwebp C library.

Which means it cannot be used from within a wasm - and arguably defeats the point somewhat of having this image processing in rust.

@fmarier
Copy link
Author

fmarier commented Oct 15, 2021

Good find Graham. I guess we won't be able to implement the ideal workflow in a straightforward way.

Let's just remove webp from wasm-thumbnail entirely for now.

@fmarier
Copy link
Author

fmarier commented Oct 22, 2021

From @tackley:

The C library would be needed to write webp; reading webp is pure rust. See https://github.com/image-rs/image/blob/master/src/codecs/webp/decoder.rs.

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

No branches or pull requests

2 participants