Class AbstractThumbnailPolicyFilterImpl

    • Constructor Detail

      • AbstractThumbnailPolicyFilterImpl

        public AbstractThumbnailPolicyFilterImpl()
    • Method Detail

      • createThumbnail

        public boolean createThumbnail​(java.io.File src,
                                       java.io.File dest,
                                       ImageFormat format,
                                       int maxWidth,
                                       int maxHeight,
                                       java.lang.String background,
                                       boolean square,
                                       boolean done)
        Description copied from interface: ThumbnailPolicyFilter
        This method is a hook called by Thumbnail tag to generate a thumbnail of the given source file.
        Specified by:
        createThumbnail in interface ThumbnailPolicyFilter
        Overrides:
        createThumbnail in class BasicThumbnailPolicyFilter
        Parameters:
        src - source file of which to create a thumbnail
        dest - destination file (the thumbnail to generate)
        format - the format of the file to generate as requested by the ThumbnailTag
        maxWidth - the maximum width of the thumbnail to generate
        maxHeight - the maximum height of the thumbnail to generate
        background - the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeight
        square - set to true to crop image into a square using the specified width during thumbnail creation.
        done - the global plugin createThumbnail() status
        Returns:
        true on success, or false if the thumbnail could not be created
        See Also:
        ThumbnailPolicyFilter.createThumbnail(File, File, ImageFormat, int, int, String, boolean, boolean)
      • isValidImageSize

        public boolean isValidImageSize​(java.io.File imgFile,
                                        long width,
                                        long height)
        Parameters:
        imgFile - the image File being checked (only used for logging)
        width - the widht of the image (in pixel)
        height - the heigth of the image (in pixel)
        Returns:
        true if the given dimension are valid, false otherwise
        See Also:
        ThumbnailPolicyFilter.isValidImageSize(File, long, long, boolean)
      • createThumbnail

        public abstract boolean createThumbnail​(FileDocument doc,
                                                java.io.File dest,
                                                ImageFormat format,
                                                int maxWidth,
                                                int maxHeight,
                                                java.lang.String background,
                                                boolean square,
                                                boolean done)
        Description copied from interface: ThumbnailPolicyFilter
        This method is a hook called by Thumbnail tag to generate a thumbnail of the given FileDocument.
        Specified by:
        createThumbnail in interface ThumbnailPolicyFilter
        Overrides:
        createThumbnail in class BasicThumbnailPolicyFilter
        Parameters:
        doc - FileDocument of which to create a thumbnail
        dest - destination file (the thumbnail to generate)
        format - the format of the file to generate as requested by the ThumbnailTag
        maxWidth - the maximum width of the thumbnail to generate
        maxHeight - the maximum height of the thumbnail to generate
        background - the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeight
        square - set to true to crop image into a square using the specified width during thumbnail creation.
        done - the global plugin createThumbnail() status
        Returns:
        true on success, or false if the thumbnail could not be created
        See Also:
        ThumbnailPolicyFilter.createThumbnail(FileDocument, File, ImageFormat, int, int, String, boolean, boolean)
      • createThumbnail

        public boolean createThumbnail​(java.net.URL url,
                                       java.io.File dest,
                                       ImageFormat format,
                                       int maxWidth,
                                       int maxHeight,
                                       java.lang.String background,
                                       boolean square,
                                       boolean done)
        Description copied from interface: ThumbnailPolicyFilter
        This method is a hook called by Thumbnail tag to generate a thumbnail of the given URL.
        Specified by:
        createThumbnail in interface ThumbnailPolicyFilter
        Overrides:
        createThumbnail in class BasicThumbnailPolicyFilter
        Parameters:
        url - the URL of which to create a thumbnail
        dest - destination file (the thumbnail to generate)
        format - the format of the file to generate as requested by the ThumbnailTag
        maxWidth - the maximum width of the thumbnail to generate
        maxHeight - the maximum height of the thumbnail to generate
        background - the background color (eg "FFFFFF") if sets the image dimension will be set maxWidth and maxHeight
        square - set to true to crop image into a square using the specified width during thumbnail creation.
        done - the global plugin createThumbnail() status
        Returns:
        true on success, or false if the thumbnail could not be created
        See Also:
        ThumbnailPolicyFilter.createThumbnail(URL, File, ImageFormat, int, int, String, boolean, boolean)