Interface Image

    • Method Detail

      • getUrl

        @ReferField
        String getUrl()
        Returns the URL to the image file. Generally this returns a relative URL, but in some cases (for example when the image is associated with a different website then the website of the active session) it may return an absolute URL. Use getRelativeUrl or getAbsoluteUrl if you want to ensure the type of URL you want. The returned URL cannot be null.
        Returns:
        the URL to the image file (relative or absolute). Cannot be null.
      • getRelativeUrl

        String getRelativeUrl()
        Returns the URL of this image, relatively to the www root directory. Note that the www root directory is website independent. The upload and upload mm directories however are website specific, these directories are part of the relative URL returned by this method. The relative URL cannot be null.
        Returns:
        The URL of this image, relatively to the www root directory. Cannot be null.
      • getAbsoluteUrl

        String getAbsoluteUrl()
        Returns the absolute URL to the image file. The absolute URL cannot be null.
        Returns:
        the absolute URL to the image file. Cannot be null.
      • getHtmlTag

        @Deprecated
        String getHtmlTag()
        Deprecated.
        html tag is not xhtml strict compliant, create tag from presentation JSP.
        Returns html img tag for image.
        Returns:
        html img tag for image.
      • getWidth

        @ReferField
        int getWidth()
        Returns image width.
        Returns:
        image width.
      • getHeight

        @ReferField
        int getHeight()
        Returns image height.
        Returns:
        image height.
      • getFile

        File getFile()
        Returns the physical file that holds the image.
        Returns:
        the physical file that holds the image
      • getFileResource

        FileResource getFileResource()
        Returns the image as file resource
        Returns:
        the image as file resource
        Since:
        10.32.0
      • getFileSize

        @ReferField(indexed=true)
        long getFileSize()
        Returns the size in bytes of the file that holds the image. If no file is attached this method returns 0.
        Returns:
        size in bytes of the image file or 0 if no file is attached
      • getAlign

        String getAlign()
        Returns alignment.
        Returns:
        alignment.
      • getWebsite

        Website getWebsite()
        Returns website which owns the image.
        Returns:
        website which owns the image.
      • isExists

        boolean isExists()
        Returns whether image exists. Useful when using >wm:image< tag for testing availability.
        Returns:
        true if image exists, false otherwise.
      • getAlternativeText

        @ReferField(stored=false,
                    body=true)
        String getAlternativeText()
        Returns alt text for the HTML IMG tag.
        Returns:
        alt text for the HTML IMG tag.
      • getSizedImage

        Image getSizedImage​(int width,
                            int height)
        Returns the cropped image for a particular size taking the focus point set into account.
        Parameters:
        width - Resize the image to this width.
        height - Resize the image to this height.
        Returns:
        the cropped image for a particular size.
      • getFocusPointX

        int getFocusPointX()
        Returns the focus point X value.
        Returns:
        The focus point X value or -1 when not set
      • getFocusPointY

        int getFocusPointY()
        Returns the focus point Y value.
        Returns:
        The focus point Y value or -1 when not set