diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2016-02-25 10:46:21 +0000 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2016-02-25 10:46:21 +0000 |
commit | 809aa390bf2c0acd1307134d298aaa4d1a4e3c74 (patch) | |
tree | 32b39b3e4729363d0f41be2cd665f70ab05b917a /src/loader.c | |
parent | bc90a0adcc5b22d2bf0158333eb6dfb34c402d48 (diff) | |
parent | 66de2c49e55fcb260ea8cfdbc997d8acfb59413a (diff) | |
download | imv-809aa390bf2c0acd1307134d298aaa4d1a4e3c74.tar.gz |
Merge pull request #82 from czarkoff/exif
Use Exif rotation for JPEG images
Diffstat (limited to 'src/loader.c')
-rw-r--r-- | src/loader.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/loader.c b/src/loader.c index 35e7450..e7d0321 100644 --- a/src/loader.c +++ b/src/loader.c @@ -227,13 +227,15 @@ static void *bg_new_img(void *data) } else { /* Future TODO: If we load image line-by-line we could stop loading large * ones before wasting much more time/memory on them. */ + + int flags = (fmt == FIF_JPEG) ? JPEG_EXIFROTATE : 0; FIBITMAP *image; if(from_stdin) { pthread_mutex_lock(&ldr->lock); - image = FreeImage_LoadFromMemory(fmt, ldr->fi_buffer, 0); + image = FreeImage_LoadFromMemory(fmt, ldr->fi_buffer, flags); pthread_mutex_unlock(&ldr->lock); } else { - image = FreeImage_Load(fmt, path, 0); + image = FreeImage_Load(fmt, path, flags); } if(!image) { error_occurred(ldr); |