Package digilib.io
Class ImageFile
java.lang.Object
digilib.io.ImageInput
digilib.io.ImageFile
- Author:
- casties
-
Nested Class Summary
Nested classes/interfaces inherited from class digilib.io.ImageInput
ImageInput.InputTag -
Field Summary
Fields inherited from class digilib.io.ImageInput
mimetype, pixelSize, tags, tileSize -
Constructor Summary
ConstructorsConstructorDescriptionImageFile(File f, FsDirectory parentDir) Constructor with File.ImageFile(String fn, FsDirectory dir) Constructor with filename (without path). -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck()Checks the image and sets size and type.floatReturns the aspect ratio of the image (width/height).getFile()Returns the input as File (if available)Returns the input as ImageInputStream (if available)getName()Returns the file name (without path).getSize()booleanhasFile()Returns if the input can be returned as File.booleanReturns if the input can be returned as ImageInputStream.booleanReturns if the input has the given tag.toString()Methods inherited from class digilib.io.ImageInput
getInputStream, getTags, hasInputStream, hasMimetype, isChecked, setMimetype, setSize, setTag, setTags, setTileSize
-
Constructor Details
-
ImageFile
Constructor with File.- Parameters:
f- the FileparentDir- the Directory
-
ImageFile
Constructor with filename (without path).- Parameters:
fn- the fndir- the Directory
-
-
Method Details
-
check
public void check()Checks the image and sets size and type. -
getSize
- Overrides:
getSizein classImageInput- Returns:
- ImageSize
-
getTileSize
- Overrides:
getTileSizein classImageInput- Returns:
- the tileSize
-
getMimetype
- Overrides:
getMimetypein classImageInput- Returns:
- String
-
getAspect
public float getAspect()Description copied from class:ImageInputReturns the aspect ratio of the image (width/height).- Overrides:
getAspectin classImageInput- Returns:
- the aspect ratio
-
hasTag
Description copied from class:ImageInputReturns if the input has the given tag. Always matches if tag==null.- Overrides:
hasTagin classImageInput- Parameters:
tag-- Returns:
-
getName
Returns the file name (without path).- Returns:
- the name
-
hasImageInputStream
public boolean hasImageInputStream()Description copied from class:ImageInputReturns if the input can be returned as ImageInputStream.- Overrides:
hasImageInputStreamin classImageInput- Returns:
- has ImageInputStream
-
getImageInputStream
Description copied from class:ImageInputReturns the input as ImageInputStream (if available)- Overrides:
getImageInputStreamin classImageInput- Returns:
- the ImageInputStream
-
hasFile
public boolean hasFile()Description copied from class:ImageInputReturns if the input can be returned as File.- Overrides:
hasFilein classImageInput- Returns:
- has File
-
getFile
Description copied from class:ImageInputReturns the input as File (if available)- Overrides:
getFilein classImageInput- Returns:
- the File
-
toString
-