cancel
Showing results for 
Search instead for 
Did you mean: 

convert image with transformImage and draw watermark

awilczew
Champ in-the-making
Champ in-the-making
We have a script which will resize  images and watermark it with a text.

Our command for transformation is:

width = 120;
height = 120;
Bfontsize =  16;
var thumbImage = n.transformImage( "image/tiff", '-resize '+ width +'x'+ height +'-quality 95 -font Helvetica -pointsize '+ Bfontsize +' -draw "gravity southeast fill silver text 0,12 \'Watermark\'" ',GtargetFolderNeu );

In the version 4.0.c this command will do the job. But after upgrade to 4.0.e  we get a error.

If we just use:

var thumbImage = n.transformImage( "image/tiff", '-resize '+ width +'x'+ height +'-quality 95 ',GtargetFolderNeu );

it will work fine, but if we axpand with watermarking the error will arise. I think in the 3.4 Version it was a similar error. Maybe the quotation marks from the -draw param will not be parsed. Can anyone help me.


Here is the error:

2012-09-03 08:29:32,154  DEBUG [content.transform.TransformerDebug] [http-8080-31] 118         store://2012/8/31/16/1/b2681636-48b1-48a6-9798-87d53d3efa5c.bin
2012-09-03 08:29:32,154  DEBUG [content.transform.TransformerDebug] [http-8080-31] 118         jpg  jpg  95K transformer.ImageMagick<<Proxy>>
2012-09-03 08:29:32,154  TRACE [content.transform.TransformerDebug] [http-8080-31] 118         image/jpeg image/jpeg
2012-09-03 08:29:32,280  DEBUG [content.transform.TransformerDebug] [http-8080-31] 118         Failed 08033070 Failed to perform ImageMagick transformation:
Execution result:
   os:         Linux
   command:    [/opt/alfresco-4.0.e/common/bin/convert, /opt/alfresco-4.0.e/tomcat/temp/Alfresco/ImageMagickContentTransformerWorker_source_3037866582266022043.jpg[0], -resize, 100x100, -quality, 95, -font, Helvetica, -pointsize, 30, -draw, gravity southeast fill silver text 0,12 'Watermark', -auto-orien, /opt/alfresco-4.0.e/tomcat/temp/Alfresco/ImageMagickContentTransformerWorker_target_5942017631833632530.jpg]
   succeeded:  false
   exit code:  1
   out:       
   err:        .convert.bin: unrecognized option `-auto-orien' @ convert.c/ConvertImageCommand/680.

2012-09-03 08:29:32,280  DEBUG [content.transform.TransformerDebug] [http-8080-31] 118         Finished in 126 ms

2012-09-03 08:29:45,434  DEBUG [content.transform.ContentTransformerRegistry] [http-8443-5] Searched for transformer:
   source mimetype: image/jpeg
   target mimetype: text/plain
   transformers: []
2012-09-03 08:29:45,469  DEBUG [content.transform.TransformerDebug] [http-8443-5] 119         jpg  txt  0K ContentService.getTransformer(…) NO transformers
2012-09-03 08:29:45,469  TRACE [content.transform.TransformerDebug] [http-8443-5] 119         image/jpeg text/plain
2012-09-03 08:29:45,469  DEBUG [content.transform.TransformerDebug] [http-8443-5] 119         Finished in 36 ms Transformer NOT called
2 REPLIES 2

awilczew
Champ in-the-making
Champ in-the-making
Hello I saw that in the svn repo the code for the quotation is implemented again. I will compile from svn  and test it against my script.

christopheradam
Champ in-the-making
Champ in-the-making
<a href="http://www.rasteredge.com/how-to/vb-net-imaging/image-converting/">Image converting</a> and image watermark drawing are different, they call for different programming methods. I want to focus on image converting. Now, we can find many online or free tiral version of image converter that allows to convert image in raster from to vector file or in the vice versa.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.