Commit a7ba235e authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Merge branch 'teleshoes-autorotate'

parents c6752c19 f850bc19
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+15 −12
Original line number Diff line number Diff line
@@ -259,19 +259,22 @@ int feh_load_image(Imlib_Image * im, feh_file * file)
	}

#ifdef HAVE_LIBEXIF
	file->ed = exif_get_data(file->filename);
	int orientation = 0;
	ExifData *exifData = exif_data_new_from_file(file->filename);
	if (exifData) {
		ExifByteOrder byteOrder = exif_data_get_byte_order(exifData);
		ExifEntry *exifEntry = exif_data_get_entry(exifData, EXIF_TAG_ORIENTATION);
		if (exifEntry && opt.auto_rotate)
			orientation = exif_get_short(exifEntry->data, byteOrder);
	}
	file->ed = exifData;

	if (file->ed) {
		entry = exif_content_get_entry(file->ed->ifd[EXIF_IFD_0], 0x0112);
		if (entry != NULL) {
			if (*(entry->data) == 3)
	if (orientation == 3)
		gib_imlib_image_orientate(*im, 2);
			else if (*(entry->data) == 6)
	else if (orientation == 6)
		gib_imlib_image_orientate(*im, 1);
			else if (*(entry->data) == 8)
	else if (orientation == 8)
		gib_imlib_image_orientate(*im, 3);
		}
	}
#endif

	D(("Loaded ok\n"));
+4 −0
Original line number Diff line number Diff line
@@ -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;
+1 −0
Original line number Diff line number Diff line
@@ -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;