src.groovy.pl.burningice.plugins.image.engines.scale
Class ImageMagickAccurateScaleEngine
java.lang.Object
src.groovy.pl.burningice.plugins.image.engines.scale.ImageMagickScaleEngine
src.groovy.pl.burningice.plugins.image.engines.scale.ImageMagickApproximateScaleEngine
src.groovy.pl.burningice.plugins.image.engines.scale.ImageMagickAccurateScaleEngine
class ImageMagickAccurateScaleEngine
extends ImageMagickApproximateScaleEngine
Class allows to scale image with accurate width and height.
Result image will contain exact width and height gave by user,
if original size of image not fit to user width and height, image will be scaled
to shortest side and cropped on center
- author:
- Pawel Gdula
Property Summary |
private static int |
SIZE_CORRECTION
Specify image size correction for scaling
Sometimes during scaling there are situations
when one of the sides don't match requested size (is lover by one px)
Can be fixed by adding this 1px to image size before scale calculations.
|
Method Summary |
protected def
|
evaluateScale(Dimension currentSize, Dimension requestedSize)
|
protected byte[]
|
scaleImage(byte[] image, Dimension currentSize, Dimension requestedSize)
|
SIZE_CORRECTION
private static final int SIZE_CORRECTION
- Specify image size correction for scaling
Sometimes during scaling there are situations
when one of the sides don't match requested size (is lover by one px)
Can be fixed by adding this 1px to image size before scale calculations.
This is not important during approximate scaling, but required during accurate scaling
to match exactly requested image size.
ImageMagickAccurateScaleEngine
ImageMagickAccurateScaleEngine()
-
evaluateScale
protected def evaluateScale(Dimension currentSize, Dimension requestedSize)
-
scaleImage
protected byte[] scaleImage(byte[] image, Dimension currentSize, Dimension requestedSize)
-
Groovy Documentation