public final class ImageConverterFactoryImpl extends Object implements ImageConverterFactory
ImageIO
used to convert TIFF images to PNG or JPEG.
However, for the conversion to be performed, you must use Java 9+ to run W2X.
This class is thread-safe.
Constructor and Description |
---|
ImageConverterFactoryImpl() |
Modifier and Type | Method and Description |
---|---|
ImageConverter |
createImageConverter(String inExt,
String outExt)
Returns a image converter allowing to convert an image file having
first specified filename extension to an image file having
second specified filename extension.
|
static boolean |
cropImage(File inFile,
double top,
double right,
double bottom,
double left,
File outFile) |
String[] |
getImageConversions()
Returns an array containing pairs of strings specifying
the image conversions supported by converters created by this factory.
|
String |
getParameter(String name)
Returns the value of specified parameter.
|
void |
setParameter(String name,
String value)
Sets specified parameter.
|
public void setParameter(String name, String value)
ImageConverterFactory
setParameter
in interface ImageConverterFactory
name
- name of parametervalue
- value of parameter; use null
to unset itImageConverterFactory.getParameter(java.lang.String)
public String getParameter(String name)
ImageConverterFactory
getParameter
in interface ImageConverterFactory
name
- name of parameternull
otherwiseImageConverterFactory.setParameter(java.lang.String, java.lang.String)
public String[] getImageConversions()
ImageConverterFactory
First element of the pair is an input file extension in lower-case. Examples: wmf, emf, tif, tiff.
Second element of the pair is an output file extension in lower-case. Examples: svg, png, jpg, jpeg.
getImageConversions
in interface ImageConverterFactory
public ImageConverter createImageConverter(String inExt, String outExt) throws Exception
ImageConverterFactory
createImageConverter
in interface ImageConverterFactory
inExt
- the input filename extensionoutExt
- the output filename extensionException
- if for any reason this method failspublic static boolean cropImage(File inFile, double top, double right, double bottom, double left, File outFile) throws IOException
IOException