Kaynağa Gözat

Check VIPS_META_ORIENTATION type before get

DarthSim 6 yıl önce
ebeveyn
işleme
3696025195
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 2
      vips.c

+ 4 - 2
vips.c

@@ -200,8 +200,10 @@ vips_get_orientation(VipsImage *image) {
 #ifdef VIPS_META_ORIENTATION
   int orientation;
 
-	if (vips_image_get_int(image, VIPS_META_ORIENTATION, &orientation) == 0)
-    return orientation;
+	if (
+    vips_image_get_typeof(image, VIPS_META_ORIENTATION) == G_TYPE_INT &&
+    vips_image_get_int(image, VIPS_META_ORIENTATION, &orientation) == 0
+  ) return orientation;
 #else
   const char *orientation;