richgel999 / jpeg-compressor

C++ JPEG compression/fuzzed low-RAM JPEG decompression codec with Public Domain or Apache 2.0 license
210 stars 57 forks source link

Decoding fails for images with 4:2:0 chroma subsampling #26

Open passivestar opened 1 month ago

passivestar commented 1 month ago

Some textures found online are using 4:2:0 chroma subsampling and they can't be decoded in Godot, while every other app has no trouble with them

More context here: https://github.com/godotengine/godot/issues/91600

Problematic image from the link above: https://github.com/user-attachments/files/15511511/new_test.zip

Calinou commented 1 month ago

I don't think decoding fails with every 4:2:0 image. Otherwise, most JPEGs encoded with quality < 90 would fail to load (many apps automatically use 4:2:0 for all quality levels < 90).