Class SpincastImageWatermarkerDefault

java.lang.Object
org.spincast.plugins.watermarker.SpincastImageWatermarkerDefault
All Implemented Interfaces:
SpincastImageWatermarker

public class SpincastImageWatermarkerDefault extends Object implements SpincastImageWatermarker
  • Constructor Details

  • Method Details

    • getWatermarkerId

      protected String getWatermarkerId()
    • getText

      public String getText()
    • getTextColor

      public Color getTextColor()
    • getBackgroundColor

      public Color getBackgroundColor()
    • getTextFont

      public Font getTextFont()
    • getImageFilePath

      public String getImageFilePath()
    • isImageFileOnClasspath

      public boolean isImageFileOnClasspath()
    • getPosition

      public net.coobird.thumbnailator.geometry.Position getPosition()
    • getMargin

      public Integer getMargin()
    • getOpacity

      public float getOpacity()
    • getPercentageWidth

      public int getPercentageWidth()
    • getBorderWidth

      public Integer getBorderWidth()
    • getBorderColor

      public Color getBorderColor()
    • getSpincastUtils

      protected SpincastUtils getSpincastUtils()
    • getSpincastConfig

      protected SpincastConfig getSpincastConfig()
    • toThumbnailatorPosition

      protected net.coobird.thumbnailator.geometry.Position toThumbnailatorPosition(SpincastWatermarkPosition position, Integer margin)
    • getMainTempDir

      protected File getMainTempDir()
    • getWatermarkImagesTempDir

      protected File getWatermarkImagesTempDir()
    • isImageWatermark

      protected boolean isImageWatermark()
    • getDefaultFont

      protected Font getDefaultFont()
    • createTextWatermarkBaseImage

      protected BufferedImage createTextWatermarkBaseImage()
    • getFontSizeToCreateTextWatermarkBaseImage

      protected float getFontSizeToCreateTextWatermarkBaseImage()
    • getWatermarkOriginalImage

      protected BufferedImage getWatermarkOriginalImage()
    • getWatermarkImageForWidth

      protected BufferedImage getWatermarkImageForWidth(int width)
    • addBorder

      protected BufferedImage addBorder(BufferedImage watermarkImg)
    • getTargetWatermarkImageWidth

      protected int getTargetWatermarkImageWidth(BufferedImage originalImage)
    • watermark

      public void watermark(String originalImagePath, File targetFile)
      Description copied from interface: SpincastImageWatermarker
      Watermark an image.

      The format of the watermaked image is determined by the extension of the targetFile (case-insensitive):

      • .jpg or .jpeg => JPEG
      • .gif => GIF
      • .png => PNG

      If the target file doesn't have any extension, PNG is used.

      Specified by:
      watermark in interface SpincastImageWatermarker
      targetFile - The file where the watermarked version will be saved. If this file already exists, it is overwritten.
    • watermark

      public void watermark(String originalImagePath, boolean onClasspath, File targetFile)
      Description copied from interface: SpincastImageWatermarker
      Watermark an image.

      The format of the watermaked image is determined by the extension of the targetFile (case-insensitive):

      • .jpg or .jpeg => JPEG
      • .gif => GIF
      • .png => PNG

      If the target file doesn't have any extension, PNG is used.

      Specified by:
      watermark in interface SpincastImageWatermarker
      onClasspath - If true, the original image will be taken from the classpath. Otherwise its path must be a path on the file system.
      targetFile - The file where the watermarked version will be saved. If this file already exists, it is overwritten.
    • getOutputType

      protected String getOutputType(File targetFile)