evanw / thumbhash

A very compact representation of an image placeholder
https://evanw.github.io/thumbhash/
MIT License
3.49k stars 69 forks source link

Rust example fails with `assertion failed: w <= 100 && h <= 100` #38

Closed Quintasan closed 2 months ago

Quintasan commented 2 months ago

For some reason, the assertions fail when I try to encode the attached photo using the Rust example provided.

![photo](https://github.com/user-attachments/assets/627c6f64-99c4-48f2-ad7d-da8566937cd3)

I added println!("width: {width}, height: {height}"); before the rgba_to_thumb_hash call to see if the image crate does something bizarre, but it doesn't. I tried it with a different photo and I get the same error

![2023-05-17](https://github.com/user-attachments/assets/3a04f58c-7369-41c7-bcfa-9ab8235a461b)

Any ideas what I'm doing wrong? Both images are definitely bigger than 100x100

Quintasan commented 2 months ago

... duh

I just realized I can't read 😅