diff --git a/src/help.raw b/src/help.raw index 03c834881244206a19dd54cfab83810a8cc61518..067e35f9b27be6da0142232b71e02eab0b4182db 100644 --- a/src/help.raw +++ b/src/help.raw @@ -35,6 +35,7 @@ OPTIONS -d, --draw-filename Show the filename in the image window --draw-tinted Show overlay texts on semi-transparent background --draw-exif Show some Exif information (if compiled with exif=1) + --auto-rotate Rotate images according to Exif info (if compiled with exif=1) -^, --title TITLE Set window title (see FORMAT SPECIFIERS) -D, --slideshow-delay NUM Set delay between automatically changing slides --cycle-once Exit after one loop through the slideshow diff --git a/src/imlib.c b/src/imlib.c index 1cf2e5bd4dbdf6a71b52efb321e46dce7b5c768d..fd78d0cd21da4ecc3a930c58f7fab010db48852b 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -264,7 +264,7 @@ int feh_load_image(Imlib_Image * im, feh_file * file) if (exifData) { ExifByteOrder byteOrder = exif_data_get_byte_order(exifData); ExifEntry *exifEntry = exif_data_get_entry(exifData, EXIF_TAG_ORIENTATION); - if (exifEntry) + if (exifEntry && opt.auto_rotate) orientation = exif_get_short(exifEntry->data, byteOrder); } file->ed = exifData; diff --git a/src/options.c b/src/options.c index 9e2ff5ad272334a6cbf21a9579bf098d0f91c2fc..56323a81d1b50eb774201a32cd7b0b0b7ae5318d 100644 --- a/src/options.c +++ b/src/options.c @@ -396,6 +396,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) {"no-jump-on-resort", 0, 0, 220}, #ifdef HAVE_LIBEXIF {"draw-exif" , 0, 0, 223}, + {"auto-rotate" , 0, 0, 242}, #endif {"cycle-once" , 0, 0, 224}, {"no-xinerama" , 0, 0, 225}, @@ -730,6 +731,9 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) case 223: opt.draw_exif = 1; break; + case 242: + opt.auto_rotate = 1; + break; #endif case 224: opt.cycle_once = 1; diff --git a/src/options.h b/src/options.h index c7ce689f41e014c24e6629323e36b1a844c9a252..5a5ce8464303916a30a2213ec16aa486577ae14d 100644 --- a/src/options.h +++ b/src/options.h @@ -51,6 +51,7 @@ struct __fehoptions { unsigned char draw_filename; #ifdef HAVE_LIBEXIF unsigned char draw_exif; + unsigned char auto_rotate; #endif unsigned char list; unsigned char quiet;