-
-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JPG support in raylib #4220
Comments
I haven't used our raylib bindings yet, but I imagine you could compile raylib with the configurations you want set to enabled and use the resulting library object instead of the one shipped with Odin. That might be a good workaround for now. |
I also needed JPG support. I simply recompiled Raylib with -DCUSTOMIZE_BUILD=ON, -DSUPPORT_FILEFORMAT_JPG=ON and -Draylib_USE_STATIC_LIBS=ON to enable it, then I copied the resulting libraylib.a into the appropriate Odin directory, and recompiled Odin as well. |
I don't think we should really deviate from the default Raylib build, like others said you can recompile with support and switch out the library. An idea might be to better document (or provide scripts for) this process of recompilation. |
You could also petition Raylib upstream to have JPG included by default. I don't believe there's any patent encumbrance in JPG since the patent on arithmetic coding expired. And even while that patent was still alive, most JPG implementations (including Photoshop) went with Huffman coding instead of arithmetic coding because of that patent, so there was no reason to exclude JPG support that I can see. |
@paramita I just faced the same issue with SVG, it's very annoying from a user point of view. You're like, oh cool, I can just call LoadImageSvg() and you do it and it explode at you because in reality it's not there by default and you don't have any explanation of what to do to enable it. |
@Vonixxx Could you explain quickly how to recompile Raylib? I don't see much stuff in |
I see you're on Windows, so I cannot assist with that. I use Linux. You have to visit Raylib's own Github page for that anyhow, here's a link explaining how to build for Windows. |
I'm on MacOS. Thanks, I'll look into that for MacOS. |
Mhh I'm a bit lost, where is raylib even installed when we install Odin? How can we find that per OS? |
It's in the |
I was asking for the code but I noticed that it does not install the code itself 👍🏻 @paramita I don't know if you succeeded to compile it with JPG enabled but if not, here is how I did it on MacOS on Apple Silicon architecture (idk the Windows equivalent):
|
It seems that raylib only supports PNG/GIF/QOI/DDS by default: https://github.com/raysan5/raylib/blob/master/src/config.h#L162
It was recently discussed at https://discord.com/channels/568138951836172421/568871298428698645/1263162072557162496
I started to learn odin and wanted to build the image viewer app, so I immediately faced that issue. I hope it's possible to widen the supported image formats. For example, enabling SVG support would be beneficial for building UI elements since the vector image can be scaled to any size.
The following warning is shown when loading jpg as
Image
orTexture2D
:Operating System & Odin Version:
The text was updated successfully, but these errors were encountered: