Skip to content

[rtextures] Rotated JPG images do not load rotated #4852

@TobinCavanaugh

Description

@TobinCavanaugh
  • I tested it on latest raylib version from master branch
  • I checked there is no similar issue already reported
  • I checked the documentation on the wiki
  • My code has no errors or misuse of raylib

Issue description

Textures in the jpg format do not maintain their rotated state when loaded by Raylib. PNGs work fine, but when a jpg that has been rotated, it gets loaded as its unrotated version.

(see Issue Screenshot)

This seems to be an issue with the loading of the jpg metadata.

Environment

Windows 10 Pro, Intel Iris Xe Graphics, GL_VERSION: 3.3.0 - Build 32.0.101.5972

Issue Screenshot

Image
Image

Code Example

#include "raylib.h"

#define SCREEN_WIDTH (800)
#define SCREEN_HEIGHT (450)

#define WINDOW_TITLE "Window title"

int main(void) {
    InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, WINDOW_TITLE);
    SetTargetFPS(60);

    Texture2D reg = LoadTexture(ASSETS_PATH"regular.jpg");
    Texture2D rot = LoadTexture(ASSETS_PATH"rotated.jpg");

    while (!WindowShouldClose()) {
        BeginDrawing();
        ClearBackground(BLACK);

        DrawTexture(reg, 0, 0, WHITE);
        DrawTexture(rot, 0, reg.height, WHITE);

        DrawFPS(0, 0);
        EndDrawing();
    }

    CloseWindow();

    return 0;
}

regular.jpg and rotated.jpg
Image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    externalThis issue depends on external lib

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions