www.dextsolution.com
DEXTUPLOAD
JK
menu toggleReference > dextuploadjk > media > ImageTool

dextuploadjk.media
Class ImageTool

Minimum version
1.0.0
Minimum environment
Java 17
Description

Classes that support image processing.

DEXTUploadJK provides simple functionality to process uploaded image files or image files from a specific location.

Methods

getInstance

  • This is a static method that returns an ImageTool object from a given path or object.

  • Signatures

    public static ImageTool getInstance(String filePath)
    public static ImageTool getInstance(File file)
    public static ImageTool getInstance(BufferedImage image)
    public static ImageTool getInstance(FileItem item)
  • Parameters

    Name Type Description
    filePath java.lang.String Image file path
    file java.io.File Image java.io.File object
    image java.awt.image.BufferedImage Image java.awt.image.BufferedImage object
    item dextuploadjk.FileItem FileItem object
  • Return

    ImageTool object

  • Uses

    // Default
    ImageTool oimg = ImageTool.getInstance(item.getLastSavedFilePath());
    // 2
    ImageTool oimg = ImageTool.getInstance(new File(item.getLastSavedFilePath()));
    // 3
    ImageTool oimg = ImageTool.getInstance(buffedimg);
    // 4
    ImageTool oimg = ImageTool.getInstance(fileItem);

isImage

  • Returns whether the file is an image.

  • Signatures

    public static boolean isImage(String filePath)
    public static boolean isImage(File file)
    public static boolean isImage(FileItem item)
  • Parameters

    Name Type Description
    filePath java.lang.String Path to the target file
    file java.io.File Target java.io.File object
    item dextuploadjk.FileItem FileItem object
  • Return

    true if it's an image, or false

  • Uses

    // Default
    boolean isCheck = ImageTool.isImage(item.getLastSavedFilePath());
    // 2
    boolean isCheck = ImageTool.isImage(new File(item.getLastSavedFilePath()));
    // 3
    boolean isCheck = ImageTool.isImage(fileItem);

getImage

  • Returns a java.awt.image.BufferedImage object.

  • Signatures

    public BufferedImage getImage()
  • Return

    java.awt.image.BufferedImage object

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    BufferedImage img = oimg.getImage();

setImage

  • Sets a java.awt.image.BufferedImage object.

  • Signatures

    public void setImage(BufferedImage image)
  • Parameters

    Name Type Description
    image java.awt.image.BufferedImage java.awt.image.BufferedImage object
  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    oimg.setImage(buffedImage);

getImageFile

  • Returns a java.io.File object for the file from which the image information was read.

  • Signatures

    public File getImageFile()
  • Return

    java.io.File

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    oimg.getImageFile();

setImageFile

  • Sets the java.io.File object for the file from which the image information was read.

  • Signatures

    public void setImageFile(File imageFile)
  • Parameters

    Name Type Description
    imageFile java.io.File Image file to set
  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    oimg.setImageFile(imagefile);

getWidth

  • Returns the horizontal dimensions of the image.

  • Signatures

    public int getWidth()
  • Return

    Horizontal size (pixel)

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    oimg.getWidth();

getHeight

  • Returns the vertical size of the image.

  • Signatures

    public int getHeight()
  • Return

    Vertical size (pixels)

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    oimg.getHeight();

resize

  • Returns an ImageTool object with the resized image information.

  • Signatures

    public ImageTool resize(int width, int height, Object hint, boolean hightQuality)
    public ImageTool resize(float widthRatio, float heightRatio, Object hint, boolean hightQuality) 
  • Parameters

    Name Type Description
    width int Target image horizontal size (pixels)
    height int Target image vertical size (pixels)
    hint Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

    hightQuality boolean

    True if you want to increase the quality of the conversion, or false. If you increase the quality, the conversion will be slower.

    widthRatio float Target image horizontal ratio (0.5f for 50%)
    heightRatio float Target image vertical ratio (0.5f for 50%)
  • Return

    An ImageTool object with the resized image information.
    Note 1) In general, the resized image is a copy of the original image.
    Note 2) If it is the same size as the original image, an ImageTool object is returned that references the original image object as it is, not a copy.

  • Uses

    ImageTool dimg = oimg.resize(64, 64, RenderingHints.VALUE_INTERPOLATION_BILINEAR, true);
    // or
    ImageTool dimg = oimg.resize(0.5f, 0.5f, RenderingHints.VALUE_INTERPOLATION_BILINEAR, true);
    Original (120x84) Frame (120x140) Result (120x140)

resizeUniform

  • Returns an ImageTool object with the resized image information.

    The source image aspect ratio is preserved and resized to fit the target image aspect ratio.

    The final converted image may be smaller than the target image size.

  • Signatures

    public ImageTool resizeUniform(int width, int height, Object hint, boolean hightQuality)
    public ImageTool resizeUniform(float widthRatio, float heightRatio, Object hint, boolean hightQuality)
  • Parameters

    Name Type Description
    width int Target image horizontal size (pixels)
    height int Target image vertical size (pixels)
    hint java.lang.Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

    hightQuality boolean

    True if you want to increase the quality of the conversion, or false.
    Higher quality results in slower conversion speeds.

    widthRatio float Target image horizontal ratio (0.5f for 50%)
    heightRatio float Target image vertical ratio (0.5f for 50%)
  • Return

    An ImageTool object with the resized image information.
    Note 1) In general, the resized image is a copy of the original image.
    Note 2) If it is the same size as the original image, an ImageTool object is returned that references the original image object as it is, not a copy.

  • Uses

    ImageTool dimg = oimg.resizeUniform(300, 200, RenderingHints.VALUE_INTERPOLATION_BILINEAR, true);       
    // or
    ImageTool dimg = oimg.resizeUniform(0.5f, 0.5f, RenderingHints.VALUE_INTERPOLATION_BILINEAR, true);
    Original (120x84) Frame (120x140) Result (120x84)
    Original (68x44) Frame (120x140) Result (68x44)

resizeUniformToFit

  • An ImageTool object with the resized image information.
    Note 1) In general, the resized image is a copy of the original image.
    Note 2) If it is the same size as the original image, an ImageTool object is returned that references the original image object as it is, not a copy.

  • Signatures

    public ImageTool resizeUniformToFit(int width, int height, ImageOption.Position position, Object hint, boolean hightQuality)
    public ImageTool resizeUniformToFit(float widthRatio, float heightRatio, ImageOption.Position position, Object hint, boolean hightQuality) 
    public ImageTool resizeUniformToFit(int width, int height, ImageOption.Position position, Color bgColor, Object hint, boolean hightQuality)
    public ImageTool resizeUniformToFit(float widthRatio, float heightRatio, ImageOption.Position position, Color bgColor, Object hint, boolean hightQuality) 
  • Parameters

    Name Type Description
    width int Target image horizontal size (pixels)
    position dextuploadjk.media.ImageOption.Position An ImageOption.Position value indicating where to place the source image on the target screen.
    bgColor java.awt.Color Specifies a background color to fill the remaining white space when the scaled original image is resized to fit the target size.
    hint java.lang.Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

    hightQuality boolean

    Set true or false if you want to improve the quality of the conversion. Higher quality results in slower conversion speeds.

    widthRatio float Target image horizontal ratio (0.5f for 50%)
    heightRatio float Target image vertical ratio (0.5f for 50%)
  • Return

    An ImageTool object with the resized image information.
    Note 1) In general, the resized image is a copy of the original image.
    Note 2) If it is the same size as the original image, an ImageTool object is returned that references the original image object as it is, not a copy.

  • Uses

    //1
    ImageTool dimg = oimg.resizeUniformToFit(300, 200, ImageOption.Position.CenterMiddle, RenderingHints.VALUE_INTERPOLATION_BILINEAR, true);       
    //2
    ImageTool dimg = oimg.resizeUniformToFit(0.5f, 0.5f,ImageOption.Position.CenterMiddle, RenderingHints.VALUE_INTERPOLATION_BILINEAR, true);
    //3
    ImageTool dimg = oimg.resizeUniformToFit(300, 200, ImageOption.Position.CenterMiddle, Color.black, RenderingHints.VALUE_INTERPOLATION_BILINEAR, true);
    //4
    ImageTool dimg = oimg.resizeUniformToFit(0.5f, 0.5f,ImageOption.Position.CenterMiddle, Color.black, RenderingHints.VALUE_INTERPOLATION_BILINEAR, true);
    Original (120x84) Frame (120x140) Result (120x140)
    Original (68x44) Frame (120x140) Result (120x140)

resizeUniformToFill

  • Returns an ImageTool object with the resized image information.
    The source image's aspect ratio is preserved, and the image is resized to fit the target image's aspect ratio.
    If the source image is smaller than the target, the source image is enlarged.

  • Signatures

    public ImageTool resizeUniformToFill(int width, int height, ImageOption.Position position, Object hint, boolean hightQuality)
    public ImageTool resizeUniformToFill(float widthRatio, float heightRatio, ImageOption.Position position, Object hint, boolean hightQuality)  
  • Parameters

    Name Type Description
    width int Target image horizontal size (pixels)
    position dextuploadjk.media.ImageOption.Position An ImageOption.Position value indicating where to place the original image on the target screen.
    hint java.lang.Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

    hightQuality boolean

    True if you want to increase the quality of the conversion, or false.
    Higher quality results in slower conversion speeds.

    widthRatio float Target image horizontal ratio (0.5f for 50%)
    heightRatio float Target image vertical ratio (0.5f for 50%)
  • Return

    An ImageTool object with the resized image information.
    Note 1) In general, the resized image is a copy of the original image.
    Note 2) If it is the same size as the original image, an ImageTool object is returned that references the original image object as it is, not a copy.

  • Uses

    ImageTool dimg = oimg.resizeUniformToFill(300, 200, ImageOption.Position.CenterMiddle, RenderingHints.VALUE_INTERPOLATION_BILINEAR, true);
    // or
    ImageTool dimg = oimg.resizeUniformToFill(0.5f, 0.5f,ImageOption.Position.CenterMiddle, RenderingHints.VALUE_INTERPOLATION_BILINEAR, true);
    Original (120x84) Frame (120x140) Result (120x140)
    Original (68x44) Frame (120x140) Result (120x140)

rotate

  • Returns a dextuploadjk.ImageTool object with the rotated image information.
    Note) The returned object is newly created from the original image.

  • Signatures

    public ImageTool rotate(double degree, Color bgColor, Object hint) 
  • Parameters

    Name Type Description
    degree double The rotation angle in degrees.
    bgColor java.awt.Color The background color to fill the margins.
    hint java.lang.Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

  • Return

    An ImageTool object with rotated image information.
    Note 1) In general, the resized image is a copy of the original image.
    Note 2) In the case of an in-place rotation, an ImageTool object is returned that still references the original image object.

  • Uses

    ImageTool dimg = oimg.rotate(30, Color.red, RenderingHints.VALUE_INTERPOLATION_BILINEAR);

rotateAuto

  • Returns an ImageTool object with image information that has been automatically rotated so that the image is oriented correctly based on the rotation information contained in the image.
    The rotation information for the image is found in the Exif Orientation tag of the JPG file.
    Because the rotation operation is based on Exif information, the return value of the getMetadata method should not be null, and the returned ImageMetadata object should have Orientation information.

  • Signatures

    public ImageTool rotateAuto(Object hint) 
  • Parameters

    Name Type Description
    hint java.lang.Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

  • Return

    An ImageTool object with rotated image information.
    Note 1) In general, the resized image is a copy of the original image.
    Note 2) In case of in-place rotation, an ImageTool object is returned that still references the original image object.
    Note 3) If the image is not in JPG format or has no Orientation Exif tag information, it will not be automatically rotated.

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);                            				            
    ImageTool dimg = oimg.rotateAuto(RenderingHints.VALUE_INTERPOLATION_BILINEAR);  

rotate90CW

  • Returns an ImageTool object with the image information rotated 90 degrees clockwise.

  • Signatures

    public ImageTool rotate90CW(Object hint)
  • Parameters

    Name Type Description
    hint java.lang.Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

  • Return

    ImageTool object with rotated image information
    Note 1) In general, the resized image is a copy of the original image.

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);                            				            
    ImageTool dimg = oimg.rotate90CW(RenderingHints.VALUE_INTERPOLATION_BILINEAR); 

rotate90CCW

  • Returns an ImageTool object with image information rotated 90 degrees counterclockwise.

  • Signatures

    public ImageTool rotate90CCW(Object hint) 
  • Parameters

    Name Type Description
    hint java.lang.Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

  • Return

    ImageTool object with rotated image information
    Note 1) In general, the resized image is a copy of the original image.

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);                            				            
    ImageTool dimg = oimg.rotate90CCW(RenderingHints.VALUE_INTERPOLATION_BILINEAR); 

rotate180CW

  • Returns an ImageTool object with image information rotated 180 degrees clockwise.

  • Signatures

    public ImageTool rotate180CW(Object hint) 
  • Parameters

    Name Type Description
    hint java.lang.Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

  • Return

    ImageTool object with rotated image information
    Note 1) In general, the resized image is a copy of the original image.

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);                            				            
    ImageTool dimg = oimg.rotate180CW(RenderingHints.VALUE_INTERPOLATION_BILINEAR); 

rotate180CCW

  • Returns an ImageTool object with image information rotated 180 degrees counterclockwise.

  • Signatures

    public ImageTool rotate180CCW(Object hint) 
  • Parameters

    Name Type Description
    hint java.lang.Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

  • Return

    ImageTool object with rotated image information
    Note 1) In general, the resized image is a copy of the original image.

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);                            				            
    ImageTool dimg = oimg.rotate180CCW(RenderingHints.VALUE_INTERPOLATION_BILINEAR); 

flip

  • Returns an ImageTool object with image information rotated about the X and Y axes.

  • Signatures

    public ImageTool flip(ImageOption.Axis axis, Object hint) 
  • Parameters

    Name Type Description
    axis devpia.dextUploadNJ.media.ImageOption.Axis The dextuploadjk.media.ImageOption.Axis value indicating the axis to be rotated.
    hint java.lang.Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

  • Return

    An ImageTool object with image information rotated about the X and Y axes.
    Note 1) In general, the resized image is a copy of the original image.
    Note 2) If you rotate the image in the X axis, it will be flipped upside down.
    Note 3) If you rotate the image on the Y axis, the image will be flipped left and right.

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);                            				            
    ImageTool dimg = oimg.flip(ImageOption.Axis.X, RenderingHints.VALUE_INTERPOLATION_BILINEAR); 

flipX

  • Returns an ImageTool object with image information rotated about the X-axis.

  • Signatures

    public ImageTool flipX(Object hint) 
  • Parameters

    Name Type Description
    hint java.lang.Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

  • Return

    ImageTool object with image information rotated about the x-axis.
    Note 1) In general, the resized image is a copy of the original image.
    Note 2) If you rotate the image along the X-axis, it will be flipped upside down.

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);                            				            
    ImageTool dimg = oimg.flipX(RenderingHints.VALUE_INTERPOLATION_BILINEAR); 

flipY

  • Returns an ImageTool object with the image information rotated about the y-axis.

  • Signatures

    public ImageTool flipY(Object hint) 
  • Parameters

    Name Type Description
    hint java.lang.Object

    The interpolation method to use when drawing the new image.
    Choose one of java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC
    java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR
    java.awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.

  • Return

    ImageTool object with image information rotated about the x-axis.
    Note 1) In general, the resized image is a copy of the original image.
    Note 2) If you rotate the image along the y-axis, the left and right sides will be switched.

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);                            				            
    ImageTool dimg = oimg.flipY(RenderingHints.VALUE_INTERPOLATION_BILINEAR); 

crop

  • Returns an ImageTool object with image information that copies some area of the original image.

  • Signatures

    public ImageTool crop(int x, int y, int width, int height) 
  • Parameters

    Name Type Description
    x int X-axis coordinates of the original image
    y int The y-axis coordinates of the original image
    width int The horizontal size of the area to be copied (in pixels)
    heigth int The vertical size of the area to be copied, in pixels.
  • Return

    An ImageTool object with the image information of the copied region.

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);                            				            
    ImageTool dimg = oimg.crop(5, 10, 200, 400); 

overlay

  • Returns an ImageTool object with image information that overlays the target image or string on the source image.

  • Signatures

    public ImageTool overlay(BufferedImage over, int x, int y, float alpha)
    public ImageTool overlay(BufferedImage over, ImageOption.Position position, float alpha)
    public ImageTool overlay(String text, int x, int y, float alpha, Font font, Color fontColo) 
  • Parameters

    Name Type Description
    over java.awt.image.BufferedImage Overlay Target Image Object
    x int The x-axis overlay coordinates of the original image
    y int The y-axis overlay coordinates of the source image
    alpha float The transparency of the target image (over) (0.0f to 1.0f)
    position dextuploadjk.media.ImageOption.Position dextuploadjk.media.ImageOption.Position value indicating where to overlay
    text java.lang.String A string to overlay
    font java.awt.font

    The java.awt.Font object to render.
    Note) Fonts that are not supported by the system will not be applied.

    fontColor java.awt.Color Font color
  • Return

    ImageTool object with image information of the target image overlaid on the source image.
    Note 1) In general, the resized image is a copy of the original image.

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);    
    //1                        				            
    ImageTool dimg = bimg.overlay(oimg.getImage(), 20, 40, 0.25f);
    //2
    ImageTool cimg = bimg.overlay(oimg.getImage(), ImageOption.Position.CenterMiddle, 0.25f); 
    //3
    ImageTool cimg = bimg.overlay(overText, bimg.getWidth() / 4, bimg.getHeight() / 2, 0.25f, new Font("Arial", Font.PLAIN + Font.BOLD, 24), Color.pink);

save

  • Saves an image object to a file.

  • Signatures

    public String save(File target, ImageOption.Format format)
    public String save(File target, ImageOption.Format format, boolean overwrite)
  • Parameters

    Name Type Description
    target java.io.File An object representing the file information to save
    format dextuploadjk.media.ImageOption.Format A value representing the file type to save
    overwrite boolean Sets whether the file should be overwritten if it already exists. The default is true.
  • Returns

    Path to the saved file (Supported since version 1.1.0)

  • Exception: IOException

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    ImageTool dimg = oimg.resize(64, 64, RenderingHints.VALUE_INTERPOLATION_BILINEAR, true);
    dimg.save(new File(repositoryDir, String.format("%s.%s", item.getFilenameWithoutExtension(), fmt.name().toLowerCase())), oimg.getFormat());

saveToJpeg

  • Saves an image object as a JPG file.

  • Signatures

    public String saveToJpeg(File target)
    public String saveToJpeg(File target, boolean overwrite)
  • Parameters

    Name Type Description
    target java.io.File An object representing the file information to save
    overwrite boolean Sets whether the file should be overwritten if it already exists. Defaults to true.
  • Returns

    Path to the saved file (Supported since version 1.1.0)

  • Exception: IOException

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    oimg.saveToJpeg(new File(repositoryDir, item.getFilenameWithoutExtension().concat(".jpg")));

saveToPng

  • Saves the image object as a PNG file.

  • Signatures

    public String saveToPng(File target)
    public String saveToPng(File target, boolean overwrite)
  • Parameters

    Name Type Description
    target java.io.File An object representing the file information to save
    overwrite boolean Sets whether the file should be overwritten if it already exists. Defaults to true.
  • Returns

    Path to the saved file (Supported since version 1.1.0)

  • Exception: IOException

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    oimg.saveToPng(new File(repositoryDir, item.getFilenameWithoutExtension().concat(".png")));

saveToGif

  • Save the image object as a GIF file.

  • Signatures

    public String saveToGif(File target)
    public String saveToGif(File target, boolean overwrite) 
  • Parameters

    Name Type Description
    target java.io.File An object representing the file information to save
    overwrite boolean Sets whether the file should be overwritten if it already exists. Defaults to true.
  • Returns

    Path to the saved file (Supported since version 1.1.0)

  • Exception: IOException

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    oimg.saveToGif(new File(repositoryDir, item.getFilenameWithoutExtension().concat(".gif")));

saveToBmp

  • Save the image object as a BMP file.

  • Signatures

    public String saveToBmp(File target)
    public String saveToBmp(File target, boolean overwrite)
  • Parameters

    Name Type Description
    target java.io.File An object representing the file information to save
    overwrite boolean Sets whether the file should be overwritten if it already exists. Defaults to true.
  • Returns

    Path to the saved file (Supported since version 1.1.0)

  • Exception: IOException

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    oimg.saveToBmp(new File(repositoryDir, item.getFilenameWithoutExtension().concat(".bmp")));

getMetadata

  • Returns an ImageMetadata object with the Exif, Gps, and Thumbnail information written to the file if the original image has a destination file and the destination file is in JPG format.

  • Signatures

    public ImageMetadata getMetadata()
  • Return

    Returns an ImageMetadata object with Exif, Gps, and Thumbnail information, or null if the source image does not exist or the destination file is not in JPG format.

  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    ImageMetadata metadata = oimg.getMetadata(); 

setMetadata

  • Sets an ImageMetadata object with Exif, Gps, and Thumbnail information.

  • Signatures

    public void setMetadata(ImageMetadata metadata)
  • Parameters

    Name Type Description
    metadata dextuploadjk.media.ImageMetadata An object with Exif, Gps, and Thumbnail information
  • Uses

    ImageTool oimg = ImageTool.getInstance(item);
    oimg.setMetadata(metadate);