Open TheYellowArchitect opened 1 year ago
Seems that this JPG file use not supported sampling factors causing jpeg_decoder::init_frame() to failed.
File godot\thirdparty\basis_universal\encoder\jpgd.cpp
line 2528
m_comp_h_samp = {2, 1, 1, 0}
m_comp_v_samp = {2, 1, 2, 0}
<= here, only value supported for the index 2 is 1.
Returning JPGD_UNSUPPORTED_SAMP_FACTORS
error.
File godot\thirdparty\basis_universal\encoder\jpgd.cpp line 2528
That JPEG decoder is only used by Basis Universal – I'm not even sure if this code is used in Godot.
https://github.com/godotengine/godot/blob/master/thirdparty/jpeg-compressor/jpgd.cpp is the decoder actually used by Godot, though its code appears nearly identical.
Following step by step debugger leads me to the Basis Universal file.
Godot version
4.0.1
System information
Arch Linux
Issue description
There are certain .jpg images where Godot just cannot import the image. The image is not corrupted, all file editors display it normally. And ofc, an X cross sign appears on the image file in godot's filesystem tab. No preview, nor loading it to some texture or sprite works.
This bug was not created in 4.0.1, I can confirm it was present since 4.0 beta14. I also tested 3.5.1, it exists there too.
Steps to reproduce
Minimal reproduction project
See above.