kornelski / cavif-rs

AVIF image creator in pure Rust
https://lib.rs/cavif
BSD 3-Clause "New" or "Revised" License
570 stars 27 forks source link

'error: too many pixels, not supported' on large files #54

Closed Shnatsel closed 2 years ago

Shnatsel commented 2 years ago

Trying to convert a 14k by 20k image to AVIF with cavif fails with the following error: too many pixels, not supported

The error comes from lodepng.

Shnatsel commented 2 years ago

Perhaps consider using the png crate which supports large images? I've checked the exact image I'm trying to convert, and it does decode correctly with the png crate.

kornelski commented 2 years ago

Yeah, maximum size lodepng allows is 268435455 pixels. This is inherited from the C implementation, which probably had to be more cautious about integer overflows. I've allowed bigger images on 64-bit machines.

Shnatsel commented 2 years ago

Has the fix been released to crates.io? I'm still getting the same error with cavif v1.3.4 and lodepng v3.6.1, which are the latest versions as of this writing. I also cannot see any relevant changes in git master in either cavif or lodepng repositories.

kornelski commented 2 years ago

Sorry, I forgot to push it. It's v3.6.2