Prevent auto-rotate fail for libmagick formats #117

This commit is contained in:
Lovell Fuller
2014-11-08 12:07:47 +00:00
parent f7c2a839ad
commit 740838b47c
2 changed files with 19 additions and 1 deletions

View File

@@ -657,7 +657,10 @@ class ResizeWorker : public NanAsyncWorker {
bool flip = FALSE;
if (angle == -1) {
const char *exif;
if (!vips_image_get_string(input, "exif-ifd0-Orientation", &exif)) {
if (
vips_image_get_typeof(input, "exif-ifd0-Orientation") != 0 &&
!vips_image_get_string(input, "exif-ifd0-Orientation", &exif)
) {
if (exif[0] == 0x36) { // "6"
rotate = ANGLE_90;
} else if (exif[0] == 0x33) { // "3"