Search code examples
nuxeo

Overriding default picture conversions in Nuxeo


I am trying to override default picture converter in Nuxeo.

By default, Nuxeo provides following OOTB converters

  • Thumbnail
  • Small
  • Medium
  • Large
  • Orignal

I want to reduce the converters to

  • Thumbnail
  • Orignal

Following are the configurations that I have tried

  1. Created a Multi-Module Contribution using Nuxeo-cli utility

    Steps followed to create contribution

    $>nuxeo bootstrap multi-module
    
    $>nuxeo bootstrap contribution 
    

    target component used for contribution is org.nuxeo.ecm.platform.picture.ImagingComponent

    $>nuxeo bootstrap package 
    
  2. Added following extension to the OSGI-INF/picture-conversion-core-contrib.xml file Ref

    <?xml version="1.0"?>
    <component name="org.nuxeo.ecm.platform.picture.ImagingComponent.default.config.override">
    <require>
        org.nuxeo.ecm.platform.picture.ImagingComponent.default.config
    </require>
        <extension target="org.nuxeo.ecm.platform.picture.ImagingComponent" point="pictureConversions">
            <pictureConversion chainId="Image.Blob.Resize" description="Thumbnail size" id="Thumbnail" maxSize="100" order="0" rendition="true"/>
            <pictureConversion chainId="Image.Blob.Resize" description="Original jpeg image" id="OriginalJpeg" order="100" rendition="true"/>
        </extension>
    </component>
    

    I want to keep only two picture conversions hence adding only Thumbnail converter and OriginalJpeg converter.

  3. After creating package I am installing the package on Nuxeo server with following command.

    $>nuxeoctl mp-install  /path/to/dir/sample_picture_converter-package-1.0-SNAPSHOT.zip
    

Even though the component is installed correctly on the Nuxeo server, the server is converting the images with default formats(ie. Thumbnail, Small, Medium, Large and Original).

What are the steps to override a default contribution in Nuxeo without Nuxeo studio?

Cross Posted on Nuxeo forum


Solution

  • We need to disable the default picture conversions explicitly in OSGI-INF/picture-conversion-core-contrib.xml. Given below the updated OSGI configuration.

    <?xml version="1.0"?>
    <component name="org.nuxeo.ecm.platform.picture.ImagingComponent.default.config.override">
    
        <require>
            org.nuxeo.ecm.platform.picture.ImagingComponent.default.config
        </require>
    
        <extension target="org.nuxeo.ecm.platform.picture.ImagingComponent" point="pictureConversions">
            <pictureConversion chainId="Image.Blob.Resize" description="Thumbnail size" id="Thumbnail" maxSize="100" order="0" rendition="true"/>
            <pictureConversion chainId="Image.Blob.Resize" description="Original jpeg image" id="OriginalJpeg" order="100" rendition="true"/>
            <pictureConversion chainId="Image.Blob.Resize" id="Small" enabled="false" />
            <pictureConversion chainId="Image.Blob.Resize" id="Medium" enabled="false" />
            <pictureConversion chainId="Image.Blob.Resize" id="FullHD" enabled="false" />
        </extension>
    </component>
    

    Answered by LaraGranite on Nuxeo forum