Interface ImagingService

  • All Known Implementing Classes:
    ImagingComponent

    public interface ImagingService
    Author:
    Max Stepanov
    • Method Detail

      • getPictureConversions

        List<PictureConversion> getPictureConversions()
        Returns the registered picture conversions.
        Since:
        7.1
      • crop

        Blob crop​(Blob blob,
                  int x,
                  int y,
                  int width,
                  int height)
        Crops an image.
      • resize

        Blob resize​(Blob blob,
                    String finalFormat,
                    int width,
                    int height,
                    int depth)
        Resizes image.
      • rotate

        Blob rotate​(Blob blob,
                    int angle)
        Rotates an image.
        Parameters:
        blob - a Blob containing the image
        angle - the angle of the rotation
        Returns:
        a Blob holding the rotated image
      • convertToPDF

        Blob convertToPDF​(Blob blob)
        Converts an image to PDF.
        Parameters:
        blob - a Blob containing the image
        Returns:
        a Blob holding the resulting PDF
        Since:
        8.4
      • getImageMetadata

        @Deprecated
        Map<String,​Object> getImageMetadata​(Blob blob)
        Deprecated.
        since 7.2. Please use instead org.nuxeo.binary.metadata.api.BinaryMetadataService#readMetadata(Blob, boolean)
        Retrieves metadata from an image contained in a Blob.
        Returns:
        the image metadata as a map String -> Object
      • getImageMimeType

        String getImageMimeType​(File file)
        Returns the mime-type for the given file.
      • getImageMimeType

        String getImageMimeType​(Blob blob)
        Returns the mime-type for the given Blob
        Since:
        5.7
      • getImageInfo

        ImageInfo getImageInfo​(Blob blob)
        Retrieves the ImageInfo of the Blob that is received as parameter.

        The information provided by the ImageInfo, like width, height or format, is obtained using ImageMagick (see http://www.imagemagick.org/script/index.php for more details on ImageMagick).

        Parameters:
        blob - the blob of a picture
        Returns:
        the ImageInfo of a blob
      • getConfigurationValue

        String getConfigurationValue​(String configurationName)
        Returns the value a configuration which name is received as parameter.
        Parameters:
        configurationName - the name of the configuration
        Returns:
        the value of the configuration, which can be null in case no configuration with the specified name was registered
      • getConfigurationValue

        String getConfigurationValue​(String configurationName,
                                     String defaultValue)
        Returns the value a configuration which name is received as parameter. In case no configuration with the specified name was registered, the received defaultValue parameter will be returned.
        Parameters:
        configurationName - the name of the configuration
        defaultValue - the value of the configuration
      • setConfigurationValue

        void setConfigurationValue​(String configurationName,
                                   String configurationValue)
        Sets the value of a configuration which could be used by the ImagingService.
        Parameters:
        configurationName - the name of the configuration
        configurationValue - the value of the configuration
      • computeViewFor

        PictureView computeViewFor​(Blob blob,
                                   PictureConversion pictureConversion,
                                   boolean convert)
                            throws IOException
        Computes a PictureView for the given blob and pictureConversion.
        Parameters:
        convert - true if the blob is converted to fit the pictureConversion, false if the blob is put as it in the PictureView (without any conversion)
        Returns:
        the computed picture view
        Throws:
        IOException
        Since:
        5.7
      • computeViewFor

        PictureView computeViewFor​(Blob blob,
                                   PictureConversion pictureConversion,
                                   ImageInfo imageInfo,
                                   boolean convert)
                            throws IOException
        Computes a PictureView for the given blob and pictureConversion.
        Parameters:
        imageInfo - the ImageInfo to use when computing the view
        convert - true if the blob is converted to fit the pictureConversion, false if the blob is put as it in the PictureView (without any conversion)
        Returns:
        the computed picture view
        Throws:
        IOException
        Since:
        5.7
      • computeViewsFor

        List<PictureView> computeViewsFor​(Blob blob,
                                          List<PictureConversion> pictureConversions,
                                          boolean convert)
                                   throws IOException
        Computes a List of PictureViews for the given blob and pictureConversions.
        Parameters:
        convert - true if the blob is converted to fit each PictureConversion, false if the blob is put as it in the PictureView (without any conversion)
        Returns:
        the computed picture views as a List of PictureViews
        Throws:
        IOException
        Since:
        5.7
      • computeViewsFor

        List<PictureView> computeViewsFor​(Blob blob,
                                          List<PictureConversion> pictureConversions,
                                          ImageInfo imageInfo,
                                          boolean convert)
                                   throws IOException
        Computes a List of PictureViews for the given blob and pictureConversions.
        Parameters:
        imageInfo - the ImageInfo to use when computing the view
        convert - true if the blob is converted to fit each PictureConversion, false if the blob is put as it in the PictureView (without any conversion)
        Returns:
        the computed picture views as a List of PictureViews
        Throws:
        IOException
        Since:
        5.7
      • computeViewsFor

        List<List<PictureView>> computeViewsFor​(List<Blob> blobs,
                                                List<PictureConversion> pictureConversions,
                                                ImageInfo imageInfo,
                                                boolean convert)
                                         throws IOException
        Computes a List of all PictureViews for each Blob of blobs.
        Parameters:
        imageInfo - the ImageInfo to use when computing the view
        convert - true if the blob is converted to fit each PictureConversion, false if the blob is put as it in the PictureView (without any conversion)
        Throws:
        IOException
        Since:
        5.7