info.magnolia.dam.util
Class ImageSize
java.lang.Object
info.magnolia.dam.util.ImageSize
public final class ImageSize
- extends Object
Represents the size of an image. This class is immutable.
Constructor Summary |
ImageSize(long width,
long height)
|
ImageSize
public ImageSize(long width,
long height)
getWidth
public long getWidth()
getHeight
public long getHeight()
scaleToFitIfLarger
public ImageSize scaleToFitIfLarger(long boundingWidth,
long boundingHeight)
- Scales the size to fit inside a bounding rectangle keeping the aspect ratio as is. If this image is smaller than
the bounding rectangle no change occurs.
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
valueOf
public static ImageSize valueOf(File file)
throws FileNotFoundException
- Throws:
FileNotFoundException
valueOf
public static ImageSize valueOf(InputStream inputStream)
Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.