cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] How to make ImageMagick and SWFTools working ?

Not applicable
Hi !
I'm running Alfresco Labs 3 perfectly. I've installed the SDK 3 and also the ImageMagick and SWFTools stuffs. I followed the wiki for ImageMagick.

Still, it seems that the paths use in the SDK are wrong for Windows. When I run the SDK FirstFoundationClient :
Execution result: 
   os:         Windows XP
   command:    [./ImageMagick/bin/convert, C:\DOCUME~1\bedeaub\LOCALS~1\Temp\Alfresco\ImageMagickContentTransformer_init_source_3829340959525497249.gif, C:\DOCUME~1\bedeaub\LOCALS~1\Temp\Alfresco\ImageMagickContentTransformer_init_target_3413650379055666749.png]
   succeeded:  false
   exit code:  1
   out:       
   err:        Cannot run program "./ImageMagick/bin/convert": CreateProcess error=2, Le fichier spécifié est introuvable
and :
Execution result: 
   os:         Windows XP
   command:    [./bin/pdf2swf, -V]
   succeeded:  false
   exit code:  1
   out:       
   err:        Cannot run program "./bin/pdf2swf": CreateProcess error=2, Le fichier spécifié est introuvable

As far as I know, my ImageMagick executable are placed in "C:\Program Files\ImageMagick-6.4.9-Q16\imconvert.exe" and SWFTools in "C:\Program Files\SWFTools\".
There is no ./bin in Windows !
I've added those two absolutes path in the "PATH" variable, and still I've got the error.

I guess there is a manipulation to fix this, but I searched the forum and found nothing Smiley Sad

Any help ?

Thanks a lot !

Benoit
4 REPLIES 4

Not applicable
Finally, I solved it myself Smiley Happy Actually I found two ways to make it work :

Here comes the first solution, the more "elegant" to me :
For each project which you want to use ImageMagick and SWFTools, add in their custom-repository.properties the following lines :
img.exe=C:/Program Files/ImageMagick-6.4.9-Q16/imconvert
swf.exe=C:/Program Files/SWFTools/pdf2swf

For example, with the SDK FirstFoundationClient project :
    edit <AlfrescoDir>\samples\FirstFoundationClient\build\alfresco\extension\custom-repository.properties (not the one in the SOURCE directory, but the one in the BUILD directory /!\)
    add the lines :
    img.exe=C:/Program Files/ImageMagick-6.4.9-Q16/imconvert
    swf.exe=C:/Program Files/SWFTools/pdf2swf
The other option is the simply put the .exe file in the projet :
for the "SDK FirstFoundationClient" :
    put FirstFoundationClient\ImageMagick\bin\convert.exe (create the directories and drag the .exe file)
    create FirstFoundationClient\bin and put all the files that are in C:\Program Files\SWFTools
Don't forget for both solution, if you're running Windows, to rename the convert.exe into imconvert.exe for ImageMagick Smiley Wink

that should do the trick Smiley Happy

Any solution that is better or even more elegant is welcome ! I should say that it's quite bothering to edit every custom-repository.properties for each project, so I'm searching for a "global" editing : one file that you edit and that makes it work for every project.

rliu
Champ in-the-making
Champ in-the-making
Thank you Benoit. That did the trick! Smiley Very Happy

boboss
Champ in-the-making
Champ in-the-making
Hi,

It seems that the commands are execute from the TOMCAT_HOME folder, instead of the C:\Alfresco folder (it is a bug… :? )

The solution for Alfresco 3.2r2 is to add this code in the file TOMCAT_HOME\webapps\alfresco\WEB-INF\classes\alfresco-global.properties

# ############################# #
# External executable locations #
# ############################# #
#
# Default values can be found in WEB-INF/classes/alfresco/subsystems/thirdparty/default
#
# ImageMagick
#
#img.root=./ImageMagick
#img.dyn=${img.root}/lib
#img.exe=${img.root}/bin/convert
img.root=${dir.root}/../ImageMagick

#
# pdf2swf
#
#swf.exe=./bin/pdf2swf
swf.exe=${dir.root}/../bin/pdf2swf

#
# OpenOffice
#
#ooo.exe=soffice
ooo.exe=${dir.root}/../OpenOffice.org/program/soffice
[size=85]PS : dir.root is set to C:/Alfresco/alf_data[/size]

And there are no more error messages Smiley Happy

dward
Champ on-the-rise
Champ on-the-rise
It's not a bug.

The installation instructions http://wiki.alfresco.com/w/images/6/62/Installing_and_Configuring_Alfresco_ECM_Community_Edition_3_2... tell you to set img.exe and swf.exe to absolute paths.