]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-1251: UCB ImageMagick Config Contrib (#381)
authorMichael Ritter <mikejritter@users.noreply.github.com>
Fri, 5 Jan 2024 22:30:20 +0000 (15:30 -0700)
committerGitHub <noreply@github.com>
Fri, 5 Jan 2024 22:30:20 +0000 (17:30 -0500)
Co-authored-by: Richard Millet <richard.millet@berkeley.edu>
Co-authored-by: Ray Lee <ray.lee@lyrasis.org>
3rdparty/nuxeo/nuxeo-platform-collectionspace/build.xml
3rdparty/nuxeo/nuxeo-platform-collectionspace/pom.xml
3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/META-INF/MANIFEST.MF
3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/commandline-imagemagick-contrib.xml [new file with mode: 0644]
3rdparty/nuxeo/nuxeo-server/9.10-HF30/bundles/nuxeo-platform-convert-9.10-HF30.jar [moved from 3rdparty/nuxeo/nuxeo-server/9.10-HF30/bundles/nuxeo-platform-convert-9.10-HF28.jar with 85% similarity]
build.properties

index 91b1cab0ff9dbaaf23b63f5ae538cc3259f7ede5..1c580e54a2a753c351703af30ee26e2ae281bbef 100644 (file)
@@ -61,6 +61,7 @@
     <exec executable="mvn" failonerror="true">
       <arg value="install" />
       <arg value="-Dmaven.test.skip=true" />
+      <arg value="-Dcspace.im.root=${cspace.im.root}" />
       <arg value="-f" />
       <arg value="${basedir}/pom.xml" />
       <arg value="-N" />
index f494fbb8326c853f5752000c0d463eb145aae5c8..e393ad5ae9d1ba2d83e467d0985ac7d5cdccdb39 100644 (file)
   <name>Nuxeo CollectionSpace core extension</name>
   <description> Nuxeo Enterprise Platform: CS extensions </description>
 
+  <!--
+    ImageMagick root path (must include trailing slash '/' character if specified.
+    Set using Maven -D flag:
+       mvn clean install -Dcspace.im.root='etc/'
+  -->
+  <properties>
+    <cspace.im.root></cspace.im.root>
+  </properties>
+
   <build>
+    <filters>
+      <filter>../../../build.properties</filter>
+    </filters>
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
index e5cac979594d89199ff3a3e92ef8cdc309a9a223..556b93e2c3b097a27b50976aee12102ab0d39aae 100644 (file)
@@ -8,12 +8,14 @@ Bundle-Vendor: Nuxeo
 Require-Bundle: org.nuxeo.runtime, 
  org.nuxeo.ecm.core.api,
  org.nuxeo.ecm.core,
- org.nuxeo.ecm.webapp.core
+ org.nuxeo.ecm.webapp.core,
+ org.nuxeo.ecm.platform.commandline.executor.service.defaultContrib
 Provide-Package: org.collectionspace.shared
 Nuxeo-Component: OSGI-INF/core-types-contrib.xml,
  OSGI-INF/default-life-cycle-contrib.xml,
  OSGI-INF/ecm-types-contrib.xml,
  OSGI-INF/layouts-contrib.xml,
- OSGI-INF/querymodel-contrib.xml
+ OSGI-INF/querymodel-contrib.xml,
+ OSGI-INF/commandline-imagemagick-contrib.xml
 
 
diff --git a/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/commandline-imagemagick-contrib.xml b/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/commandline-imagemagick-contrib.xml
new file mode 100644 (file)
index 0000000..88f4d46
--- /dev/null
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<!--
+  This file is based on nuxeo-platform-imaging-core-9.10.jar/OSGI-INF/commandline-imagemagick-contrib.xml
+
+  Reference: https://explorer.nuxeo.com/nuxeo/site/distribution/Nuxeo%20Platform%20LTS%202017-9.10/viewContribution/org.nuxeo.ecm.platform.picture.commandline.imagemagick--command
+-->
+<component name="cspace.org.nuxeo.ecm.platform.picture.commandline.imagemagick">
+
+  <require>org.nuxeo.ecm.platform.commandline.executor.service.defaultContrib</require>
+
+  <extension target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent" point="command">
+
+    <command name="identify" enabled="true">
+      <commandLine>${cspace.im.root}identify</commandLine>
+      <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -ping -format '%m %w %h %z %[colorspace]' #{inputFilePath}[0]</parameterString>
+      <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -ping -format "%m %w %h %z %[colorspace]" #{inputFilePath}[0]</winParameterString>
+      <installationDirective>You need to install ImageMagick.</installationDirective>
+    </command>
+
+    <command name="crop" enabled="true">
+      <commandLine>${cspace.im.root}stream</commandLine>
+      <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>
+      <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>
+      <installationDirective>You need to install ImageMagick.</installationDirective>
+    </command>
+
+    <command name="resizer" enabled="true">
+      <commandLine>${cspace.im.root}convert</commandLine>
+      <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -depth #{targetDepth} #{inputFilePath}[0] jpg:- | convert - -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</parameterString>
+      <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -depth #{targetDepth} #{inputFilePath}[0] -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</winParameterString>
+      <installationDirective>You need to install ImageMagick.</installationDirective>
+    </command>
+
+    <command name="gifResizer" enabled="true">
+      <commandLine>${cspace.im.root}convert</commandLine>
+      <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -depth #{targetDept h} #{inputFilePath}[0] -coalesce -resize #{targetWidth}x#{targetHeight} -deconstruct #{outputFilePath}</parameterString>
+      <installationDirective>You need to install ImageMagick.</installationDirective>
+    </command>
+
+    <command name="jpegResizer" enabled="true">
+      <commandLine>${cspace.im.root}convert</commandLine>
+      <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -background white -flatten -depth #{targetDepth} #{inputFilePath}[0] jpg:- | convert - -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</parameterString>
+      <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -background white -flatten -depth #{targetDepth} #{inputFilePath}[0] -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</winParameterString>
+      <installationDirective>You need to install ImageMagick.</installationDirective>
+    </command>
+
+    <command name="rotate" enabled="true">
+      <commandLine>${cspace.im.root}convert</commandLine>
+      <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{inputFilePath}[0] -rotate #{angle} #{outputFilePath}</parameterString>
+      <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{inputFilePath}[0] -rotate #{angle} #{outputFilePath}</winParameterString>
+      <installationDirective>You need to install ImageMagick.</installationDirective>
+    </command>
+
+    <command name="cropAndResize" enabled="true">
+      <commandLine>${cspace.im.root}stream</commandLine>
+      <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>
+      <installationDirective>You need to install ImageMagick.</installationDirective>
+    </command>
+
+    <command name="multiTiler" enabled="true">
+      <commandLine>${cspace.im.root}convert</commandLine>
+      <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{inputFilePath}[0] -crop #{tileWidth}x#{tileHeight} +repage #{outputFilePath}</parameterString>
+      <installationDirective>You need to install ImageMagick.</installationDirective>
+    </command>
+
+  </extension>
+
+</component>
similarity index 85%
rename from 3rdparty/nuxeo/nuxeo-server/9.10-HF30/bundles/nuxeo-platform-convert-9.10-HF28.jar
rename to 3rdparty/nuxeo/nuxeo-server/9.10-HF30/bundles/nuxeo-platform-convert-9.10-HF30.jar
index c46e04b879520fa3b56e3c30f42c428cdba82c98..bcbf498366c0e9507bc2172634f95b97d5969e87 100644 (file)
Binary files a/3rdparty/nuxeo/nuxeo-server/9.10-HF30/bundles/nuxeo-platform-convert-9.10-HF28.jar and b/3rdparty/nuxeo/nuxeo-server/9.10-HF30/bundles/nuxeo-platform-convert-9.10-HF30.jar differ
index ddfe6f4a9e3caa6fc68eed2e80bb472f0fed9d2b..90b141653fd1b4d7d44097e6876138877e659984 100644 (file)
@@ -19,6 +19,11 @@ cspace.services.context=${domain.cspace}
 cspace.services.war=${cspace.services.context}.war
 domain.nuxeo=nuxeo-server
 
+# ImageMagick's bin directory
+# Leave empty for default behavior.  Otherwise, provide the fully qualified path
+# to ImageMagick's bin directory -- you must include a trailing '/' character
+cspace.im.root=
+
 # UI settings
 cspace.ui.package.name=cspace-ui
 cspace.ui.library.name=cspaceUI