cancel
Showing results for 
Search instead for 
Did you mean: 

How can we configure imagemagick with compression during image uploading in alfresco?

faizaiqbal
Champ in-the-making
Champ in-the-making

#compression

1 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator

Storing an image in compressed form should have nothing to do with ImageMagick. What about image formats with lossy compression? Are you willing to risk loosing image quality just by having ImageMagick convert it to a variant with better compression but lower quality? ECM / Alfresco is about preserving file contents and as such it should not mess with those contents just for better storage efficiency.

I actually have developed an addon that can compress any file before sending it to the file storage folder. See GitHub - AFaust/simple-content-stores: Addon to provide a set of common content store implementation...  for details. This leaves the original file content / quality intact and is not restricted only to images.

View answer in original post

5 REPLIES 5

afaust
Legendary Innovator
Legendary Innovator

Can you elaborate a bit on your question? Compression with Imagemagick is - at first glance - unrelated to the matter of upload. The upload stream itself can be compressed if you have enable HTTP compression in either Apache Tomcat or any proxy you may have in front of Alfresco. Compression with Imagemagick depends on the format you convert an image too. For conversion of images using ImageMagick on the server side you can customize the conversion options (including compression options for compressed target formats) with Alfresco Repository-tier configuration files (and Java code if some options can't be set by default).

faizaiqbal
Champ in-the-making
Champ in-the-making

Thanks for your response. Actually there are two ways, first one is to

change rules of those file storage folder to make images compressed after

uploading and second one is to compress image first and then send it to

file storage folder to save network bandwidth. I want to implement the

second solution. Please help me how can I do that?

faizaiqbal
Champ in-the-making
Champ in-the-making

Thanks for your response. Actually there are two ways, first one is to change rules of those file storage folder to make images compressed after uploading and second one is to compress image first and then send it to file storage folder to save network bandwidth. I want to implement the second solution. Please help me how can I do that?

afaust
Legendary Innovator
Legendary Innovator

Storing an image in compressed form should have nothing to do with ImageMagick. What about image formats with lossy compression? Are you willing to risk loosing image quality just by having ImageMagick convert it to a variant with better compression but lower quality? ECM / Alfresco is about preserving file contents and as such it should not mess with those contents just for better storage efficiency.

I actually have developed an addon that can compress any file before sending it to the file storage folder. See GitHub - AFaust/simple-content-stores: Addon to provide a set of common content store implementation...  for details. This leaves the original file content / quality intact and is not restricted only to images.

faizaiqbal
Champ in-the-making
Champ in-the-making

Thanks a lot for sharing this