Transform a image with Javascript

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2017 04:33 AM
Hello, I have a problem to transform an image. I use a javascript script found in the Alfresco documentation. My version is 5.2. The script :// convert an image to JPG format and resize to thumbnail image
The log:
var thumbImage = document.transformImage('image/jpeg', '-resize 120');
ERROR [org.alfresco.repo.jscript.ScriptNode] [defaultAsyncAction4] 08110207 Unsupported transformation: transformer.ImageMagick image/jpeg to image/png
Screenshot :
The image is well converted but the resize does not work. The mimetype (property of the image) can not change.
Being a beginner, I can not understand the log message.
Thank you in advance for your help.
Olivier
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2017 05:12 AM
...unfortunally my jpeg has no Exif information, but I think the EXIF tags are not updated by imagemagick's convert.
identify shows nothing:
identify -format '%[EXIF:*]' myimage.jpg
exiftool shows info, but I think because there is no data, exiftool reads it from the physical jpeg data:
---- JFIF ----
JFIF Version : 1.01
Resolution Unit : cm
X Resolution : 28
Y Resolution : 28
---- Composite ----
Image Size : 120x27
Megapixels : 0.003
if you could provide a sample, I could test the conversion...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2017 09:04 AM
For example, the image I put in attachment has a size of 313X234, after conversion, properties other than the Mime / type have not changed. Actually, the command does not update the exifs, so the software or I have to insert the image Bmp does not accept. I think my problem will not be solved. I have at least advanced on the understanding of the operation of Alfresco.
Thanks again Martin 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2017 09:40 AM
What you can do: Configure a special transformer for your thumbnails and define a shell script/batchfile/Pythonprog/Javaclass for the conversion where the exif info is updated.
See Content Transformers (and Renditions) | Alfresco Documentation
The conversion done by Image magic convert seems to strip the exif information...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2017 10:12 AM
Thank you Martin for the time spent :-).
I'm going to move in that direction.
Have a good evening 🙂
Olivier
