Package org.spincast.plugins.watermarker
Class SpincastImageWatermarkerDefault
java.lang.Object
org.spincast.plugins.watermarker.SpincastImageWatermarkerDefault
- All Implemented Interfaces:
SpincastImageWatermarker
-
Constructor Summary
ConstructorsConstructorDescriptionSpincastImageWatermarkerDefault(String text, Color textColor, Color backgroundColor, Font textFont, String imageFilePath, boolean imageFileOnClasspath, SpincastWatermarkPosition position, Integer margin, Float opacity, Integer percentageWidth, Integer borderWidth, Color borderColor, SpincastUtils spincastUtils, SpincastConfig spincastConfig) -
Method Summary
Modifier and TypeMethodDescriptionprotected BufferedImageaddBorder(BufferedImage watermarkImg) protected BufferedImageprotected Fontprotected floatprotected Filefloatprotected StringgetOutputType(File targetFile) intnet.coobird.thumbnailator.geometry.Positionprotected SpincastConfigprotected SpincastUtilsprotected intgetTargetWatermarkImageWidth(BufferedImage originalImage) getText()protected Stringprotected BufferedImagegetWatermarkImageForWidth(int width) protected Fileprotected BufferedImagebooleanprotected booleanprotected net.coobird.thumbnailator.geometry.PositiontoThumbnailatorPosition(SpincastWatermarkPosition position, Integer margin) voidWatermark an image.voidWatermark an image.
-
Constructor Details
-
SpincastImageWatermarkerDefault
public SpincastImageWatermarkerDefault(@Nullable String text, @Nullable Color textColor, @Nullable Color backgroundColor, @Nullable Font textFont, @Nullable String imageFilePath, boolean imageFileOnClasspath, @Nullable SpincastWatermarkPosition position, @Nullable Integer margin, @Nullable Float opacity, @Nullable Integer percentageWidth, @Nullable Integer borderWidth, @Nullable Color borderColor, SpincastUtils spincastUtils, SpincastConfig spincastConfig)
-
-
Method Details
-
getWatermarkerId
-
getText
-
getTextColor
-
getBackgroundColor
-
getTextFont
-
getImageFilePath
-
isImageFileOnClasspath
public boolean isImageFileOnClasspath() -
getPosition
public net.coobird.thumbnailator.geometry.Position getPosition() -
getMargin
-
getOpacity
public float getOpacity() -
getPercentageWidth
public int getPercentageWidth() -
getBorderWidth
-
getBorderColor
-
getSpincastUtils
-
getSpincastConfig
-
toThumbnailatorPosition
protected net.coobird.thumbnailator.geometry.Position toThumbnailatorPosition(SpincastWatermarkPosition position, Integer margin) -
getMainTempDir
-
getWatermarkImagesTempDir
-
isImageWatermark
protected boolean isImageWatermark() -
getDefaultFont
-
createTextWatermarkBaseImage
-
getFontSizeToCreateTextWatermarkBaseImage
protected float getFontSizeToCreateTextWatermarkBaseImage() -
getWatermarkOriginalImage
-
getWatermarkImageForWidth
-
addBorder
-
getTargetWatermarkImageWidth
-
watermark
Description copied from interface:SpincastImageWatermarkerWatermark 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:
watermarkin interfaceSpincastImageWatermarkertargetFile- The file where the watermarked version will be saved. If this file already exists, it is overwritten.
-
watermark
Description copied from interface:SpincastImageWatermarkerWatermark 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:
watermarkin interfaceSpincastImageWatermarkeronClasspath- Iftrue, 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
-