简体   繁体   English

如何在Alfresco中使用ImageMagick?

[英]How to use ImageMagick with Alfresco?

I know Alfresco uses imagemagick for preview of images however I want to use imagemagick when uploading images to ALfresco. 我知道Alfresco使用imagemagick预览图像,但是我想在将图像上传到ALfresco时使用imagemagick。 So that only compressed images are stored in repository. 这样,只有压缩的图像才会存储在存储库中。

Any idea how can I achieve this either my manipulating configurations of Alfresco or I need to do it with some programming? 任何想法我该如何实现Alfresco的操作配置还是需要通过一些编程来实现?

Thanks 谢谢

You have a few options. 您有几种选择。 First, you could write a rule which would be triggered when objects of a certain mimetype are added to a folder. 首先,您可以编写一个规则,该规则在将某种模仿类型的对象添加到文件夹时触发。 Your custom rule code could then invoke a transformation to compress the image and then delete the source file. 然后,您的自定义规则代码可以调用转换以压缩图像,然后删除源文件。 One drawback to this approach is that the original file does exist in the repo for a time. 这种方法的一个缺点是原始文件确实在存储库中存在了一段时间。 The second drawback is that you'd have to configure it on every folder. 第二个缺点是您必须在每个文件夹上对其进行配置。 This tutorial explains how to write a custom rule action. 本教程说明了如何编写自定义规则操作。

The second option would be to implement a behavior. 第二种选择是实现行为。 Your custom behavior code can look for a node creation event and take action when it sees one happen. 您的自定义行为代码可以查找节点创建事件,并在事件发生时采取措施。 When it sees an image it could then invoke a transformation and replace the original. 当看到图像时,它可以调用转换并替换原始图像。 This tutorial explains how to write custom behaviors. 本教程说明了如何编写自定义行为。

The third option would be to do a much lower level extension of the node service, so that the original object never actually gets created but is first compressed. 第三种选择是对节点服务进行低得多的扩展,以使原始对象永远不会真正被创建,而是先被压缩。 That would be much more involved than either of the options above. 这将比上面的任何一个选项都要复杂得多。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用ImageMagick从另一个图像中减去图像? - How to use ImageMagick to substract a image from another? 如何在ImageMagick中使用Intel IPL库以及如何从IPL转换为ImageMagick? - How to use the Intel IPL library in ImageMagick and How to convert from IPL to ImageMagick? 如何使用ImageMagick批量转换/调整具有不同方向的图像? - How to do mass convert/resize images with different orientaton with use ImageMagick? 如何使用Imagemagick删除颜色配置文件而不删除EXIF数据? - How to use Imagemagick to remove color profile without removing EXIF data? imagemagick:如何在绘制矩形命令中使用 %[fx:...] 运算符? - imagemagick: how to use the %[fx:…] operator in draw rectangle command? 如何在.bat文件(Windows)中使用ImageMagick调整所有子目录中所有图像的大小? - How would I use ImageMagick in a .bat file (Windows) to resize all images in all sub-directories? 如何在opencv c ++ / opencv java中使用fred的imagemagick textcleaner脚本? - how to use fred's imagemagick textcleaner script in opencv c++/opencv java? Imagemagick:如何获取图像宽度,然后使用它将文件夹中的所有图像批量调整为宽度 x 宽度 / 2? - Imagemagick: How to get image width, then use that to batch resize all images in folder to width x width / 2? 如何使用ImageMagick二进制图像? - How to binaries image using ImageMagick? 如何正确链接imagemagick中的操作 - how to properly chain the operations in imagemagick
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM