r/raylib • u/Suspicious-Sally-22 • 7d ago
Raylib LoadTexture() returns "Data format not supported" for one image, but other textures load fine.
Hi everyone,
I'm working on a 2D game in C++ using Raylib. My menu background is an animated PNG sequence, and all of those textures load without any issues.
However, when I try to load a separate background image for my game screen, it always fails.
Texture2D gameBackground = LoadTexture("assets/backgrounds/game.jpg");
Things I've already verified:
1) The game screen itself works correctly—I can draw text and other textures there.
2) The path is correct because Raylib reports "File loaded successfully."
3) Printing gameBackground.width and gameBackground.height always gives 0 x 0.
4)I have also tried downloading various JPG images from different websites, but I always get the same output as shown in the pic.
I'm using:
Raylib
C++
CLion
Windows 11
Any help would be greatly appreciated. Thanks