deltaphc / raylib-rs

Rust bindings for raylib
Other
715 stars 123 forks source link

jpg not supported #169

Open jptrzy opened 9 months ago

jptrzy commented 9 months ago

While I create Image or Texture2D using jpg it allays write

INFO: FILEIO: [**] File loaded successfully
WARNING: IMAGE: File format not supported
WARNING: IMAGE: [***] Failed to load data

Png files work normally.

Maybe their is an option to enable that I'm missing? Thou I couldn't find any information about it.

Are their any system libraries for it to work?

System

os: Linux - Nixos rustc: 1.72.0

Cargo.toml:

raylib = "3.7.0"

Danrejk commented 8 months ago

I have been trying to find a way to add .jpg support as well. Apparently there used to be support for .jpg, then it was added back, but now it doesn't work? I'm not all too sure.

I hope someone knows the answer, because .jpg support would come in very handy for my program.

jestarray commented 8 months ago

jpg is supported by raylib however it is not enabled by default and there's no configuration on exposing it atm so you will need to edit the bindings manually: https://github.com/deltaphc/raylib-rs/blob/master/raylib-sys/build.rs#L61 add:

.define("SUPPORT_FILEFORMAT_JPG", "ON")
uzervlad commented 5 days ago

The SUPPORT_FILEFORMAT_JPG flag was added in 5.0, however JPEGs still fail to load.

jestarray commented 5 days ago

maybe the flag name changed or something? @IoIxD can you check if you can load jpeg?