cancel
Showing results for 
Search instead for 
Did you mean: 

Using ImageMagickContentTransformer

fgarcia
Champ in-the-making
Champ in-the-making
Does anybody know about how to use the ImageMagickContentTransformer?

My doubt is about the transform method, the one that receives a map containing a set of properties.

I haven't found any javadoc also.

I just want to resize an image using it.

Thanks,

Frank
2 REPLIES 2

kevinr
Star Contributor
Star Contributor
Yes you can use it to resize an image, it is commonly used to create thumbnails in Alfresco:
http://www.imagemagick.org/script/command-line-options.php

Thanks,

Kevin

fgarcia
Champ in-the-making
Champ in-the-making
I'm new developing on Alfresco so I'm just a little lost getting information Smiley Wink.

Looks like the Map of options, the KEY_OPTION is where imagemagick options should be set.

    String options = "-resize " + width + "x" + heigth;
    Map<String, Object> mapOptions = new HashMap<String, Object>();
    mapOptions.put(ImageMagickContentTransformer.KEY_OPTIONS, options);

    transformer.transform(reader, writer, mapOptions);

Let me know if I'm wrong,

Thanks for replying