]> granicus.if.org Git - imagemagick/commitdiff
Support printsize.{x,y} properties
authorCristy <urban-warrior@imagemagick.org>
Sun, 19 Aug 2018 11:07:50 +0000 (07:07 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 19 Aug 2018 11:07:50 +0000 (07:07 -0400)
MagickCore/property.c

index 65642be00059050885673b84f7b2646d7cd02b9d..0b8be369de8d8d327cb4d21ada80b432826eca20 100644 (file)
@@ -3106,6 +3106,20 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
             }
       }
 #endif
+      if (LocaleCompare("printsize.x",property) == 0)
+        {
+          WarnNoImageReturn("\"%%[%s]\"",property);
+          (void) FormatLocaleString(value,MagickPathExtent,"%.*g",
+            GetMagickPrecision(),image->colors/image->resolution.x);
+          break;
+        }
+      if (LocaleCompare("printsize.y",property) == 0)
+        {
+          WarnNoImageReturn("\"%%[%s]\"",property);
+          (void) FormatLocaleString(value,MagickPathExtent,"%.*g",
+            GetMagickPrecision(),image->rows/image->resolution.y);
+          break;
+        }
       if (LocaleCompare("profiles",property) == 0)
         {
           const char