]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 6 Jan 2014 02:03:41 +0000 (02:03 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 6 Jan 2014 02:03:41 +0000 (02:03 +0000)
Magick++/lib/Image.cpp
Magick++/lib/Magick++/Image.h

index 25503aa77f73e3c6e5ab208320b5210b17316c77..5484c86605eea79876ff51c181f9aace640060cb 100644 (file)
@@ -4129,6 +4129,28 @@ void Magick::Image::threshold(const double threshold_)
   ThrowPPException;
 }
 
+void Magick::Image::thumbnail(const Geometry &geometry_)
+{
+  MagickCore::Image
+    *newImage;
+
+  size_t
+    height=rows(),
+    width=columns();
+
+  ssize_t
+    x=0,
+    y=0;
+
+  ParseMetaGeometry(static_cast<std::string>(geometry_).c_str(),&x,&y,&width,
+    &height);
+
+  GetPPException;
+  newImage=ThumbnailImage(constImage(),width,height,&exceptionInfo);
+  replaceImage(newImage);
+  ThrowPPException;
+}
+
 void Magick::Image::transform(const Geometry &imageGeometry_)
 {
   modifyImage();
@@ -4507,4 +4529,4 @@ void Magick::Image::unregisterId(void)
 {
   modifyImage();
   _imgRef->id(-1);
-}
\ No newline at end of file
+}
index d95b9e9965c6dd143136350972d47e1be74716d7..86b8ca098e2b328ff3733408f2ba3f63f9554df7 100644 (file)
@@ -1236,6 +1236,9 @@ namespace Magick
     // Threshold image
     void threshold(const double threshold_);
 
+    // Resize image to thumbnail size
+    void thumbnail(const Geometry &geometry_);
+
     // Transform image based on image and crop geometries
     // Crop geometry is optional
     void transform(const Geometry &imageGeometry_);