3 This file is based on nuxeo-platform-imaging-core-9.10.jar/OSGI-INF/commandline-imagemagick-contrib.xml
5 Reference: https://explorer.nuxeo.com/nuxeo/site/distribution/Nuxeo%20Platform%20LTS%202017-9.10/viewContribution/org.nuxeo.ecm.platform.picture.commandline.imagemagick--command
7 <component name="cspace.org.nuxeo.ecm.platform.picture.commandline.imagemagick">
9 <require>org.nuxeo.ecm.platform.commandline.executor.service.defaultContrib</require>
11 <extension target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent" point="command">
13 <command name="identify" enabled="true">
14 <commandLine>${cspace.im.root}identify</commandLine>
15 <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -ping -format '%m %w %h %z %[colorspace]' #{inputFilePath}[0]</parameterString>
16 <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -ping -format "%m %w %h %z %[colorspace]" #{inputFilePath}[0]</winParameterString>
17 <installationDirective>You need to install ImageMagick.</installationDirective>
20 <command name="crop" enabled="true">
21 <commandLine>${cspace.im.root}stream</commandLine>
22 <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -map rgb -storage-type char -extract #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0] - | convert -depth 8 -size #{tileWidth}x#{tileHeight} rgb:- #{outputFilePath}</parameterString>
23 <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -map rgb -storage-type char -extract #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0] - | convert -depth 8 -size #{tileWidth}x#{tileHeight} rgb:- #{outputFilePath}</winParameterString>
24 <installationDirective>You need to install ImageMagick.</installationDirective>
27 <command name="resizer" enabled="true">
28 <commandLine>${cspace.im.root}convert</commandLine>
29 <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -depth #{targetDepth} #{inputFilePath}[0] jpg:- | convert - -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</parameterString>
30 <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -depth #{targetDepth} #{inputFilePath}[0] -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</winParameterString>
31 <installationDirective>You need to install ImageMagick.</installationDirective>
34 <command name="gifResizer" enabled="true">
35 <commandLine>${cspace.im.root}convert</commandLine>
36 <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -depth #{targetDept h} #{inputFilePath}[0] -coalesce -resize #{targetWidth}x#{targetHeight} -deconstruct #{outputFilePath}</parameterString>
37 <installationDirective>You need to install ImageMagick.</installationDirective>
40 <command name="jpegResizer" enabled="true">
41 <commandLine>${cspace.im.root}convert</commandLine>
42 <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -background white -flatten -depth #{targetDepth} #{inputFilePath}[0] jpg:- | convert - -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</parameterString>
43 <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -background white -flatten -depth #{targetDepth} #{inputFilePath}[0] -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</winParameterString>
44 <installationDirective>You need to install ImageMagick.</installationDirective>
47 <command name="rotate" enabled="true">
48 <commandLine>${cspace.im.root}convert</commandLine>
49 <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{inputFilePath}[0] -rotate #{angle} #{outputFilePath}</parameterString>
50 <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{inputFilePath}[0] -rotate #{angle} #{outputFilePath}</winParameterString>
51 <installationDirective>You need to install ImageMagick.</installationDirective>
54 <command name="cropAndResize" enabled="true">
55 <commandLine>${cspace.im.root}stream</commandLine>
56 <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -map #{mapComponents} -storage-type char -extract #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0] - | convert -depth 8 -size #{tileWidth}x#{tileHeight} -resize #{targetWidth}x#{targetHeight}! #{mapComponents}:- #{outputFilePath}</parameterString>
57 <installationDirective>You need to install ImageMagick.</installationDirective>
60 <command name="multiTiler" enabled="true">
61 <commandLine>${cspace.im.root}convert</commandLine>
62 <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{inputFilePath}[0] -crop #{tileWidth}x#{tileHeight} +repage #{outputFilePath}</parameterString>
63 <installationDirective>You need to install ImageMagick.</installationDirective>