diff --git a/src/org/im4java/core/IMOps.java b/src/org/im4java/core/IMOps.java index 0db07c1..024532b 100644 --- a/src/org/im4java/core/IMOps.java +++ b/src/org/im4java/core/IMOps.java @@ -11911,6 +11911,30 @@ public IMOps resize(Integer width) { return this; } + ////////////////////////////////////////////////////////////////////////////// + + /** + Add option -resize % to the ImageMagick commandline + (see the documentation of ImageMagick for details). + */ + + public IMOps percentageResize(Integer width) { + + String oper; // only used in some methods + StringBuffer buf = new StringBuffer(); // local buffer for option-args + iCmdArgs.add("-resize"); + + if (width != null) { + buf.append(width.toString()); + buf.append("%"); + } + if (buf.length()>0) { + iCmdArgs.add(buf.toString()); + } + return this; + } + + ////////////////////////////////////////////////////////////////////////////// /**