aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/image.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/image.c b/src/image.c
index ea5d231720b..e1b167de3d2 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8560,6 +8560,16 @@ imagemagick_load_image (struct frame *f, struct image *img,
8560 return 0; 8560 return 0;
8561 } 8561 }
8562 8562
8563 /* If no :rotation is explicitly specified, apply the automatic
8564 rotation from EXIF. */
8565 if (NILP (image_spec_value (img->spec, QCrotation, NULL)))
8566 if (MagickAutoOrientImage (image_wand) == MagickFalse)
8567 {
8568 image_error ("Error applying automatic orientation in image `%s'", img->spec);
8569 DestroyMagickWand (image_wand);
8570 return 0;
8571 }
8572
8563 if (ino < 0 || ino >= MagickGetNumberImages (image_wand)) 8573 if (ino < 0 || ino >= MagickGetNumberImages (image_wand))
8564 { 8574 {
8565 image_error ("Invalid image number `%s' in image `%s'", image, img->spec); 8575 image_error ("Invalid image number `%s' in image `%s'", image, img->spec);
@@ -8660,7 +8670,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
8660 image_spec_value (img->spec, QCbackground, NULL); if (!STRINGP 8670 image_spec_value (img->spec, QCbackground, NULL); if (!STRINGP
8661 (specified_bg). */ 8671 (specified_bg). */
8662 value = image_spec_value (img->spec, QCrotation, NULL); 8672 value = image_spec_value (img->spec, QCrotation, NULL);
8663 if (FLOATP (value)) 8673 if (FLOATP (value) || INTEGERP (value))
8664 { 8674 {
8665 rotation = extract_float (value); 8675 rotation = extract_float (value);
8666 status = MagickRotateImage (image_wand, bg_wand, rotation); 8676 status = MagickRotateImage (image_wand, bg_wand, rotation);