Wednesday, May 04, 2011

Alfresco as an Image Archive Server (TIFF/fax/scan images)

Currently evaluating Alfresco CE 3.4.d for use as an Image Archive/Record Content Management Server. Definition is to store multi-page TIFF images that have 2-6 custom attributes that must be searchable to retrieve the associated images.

The most common usecase that doesn't involve company-specific attributes as an example is storing incoming Fax images where you want to store attributes such as the number dialed to come in (enterprise w/ DID or similar fax setup), date it came in, number it came from (if available). For the number dialed in, you could instead say 'Department'.

Anyway, this post isn't about the custom attributes piece, this is for the image piece.

Req 1, allow to store and view multipage TIFF images (preferably without requiring a TIFF plugin that will likely change on Office upgrades).

Alfresco by default does not handle multipage TIFF. In fact, 3.4.d the supplied ImageMagick doesn't even support TIFF (see /alfresco/common/bin 'convert -list configure', DELEGATES line, should see TIF and it isn't there). 3.4.e DOES support TIF, but only for windows and 64-bit linux, and only the *first* page of the TIF.

Luckily, this wonderful community member of the open source product Alfresco already had a solution: http://fabiostrozzi.eu/2010/10/27/improving-tiff-preview-in-alfresco-share/

With additional modifications to remove ImageMagick, OpenOffice, and other ancillary services that were not needed for something soley to be a TIFF-based Image Server, a rather slim solution that with the default 'SHARE' interface is a good solution. I do have 3.4.d working with this solution, and will be doing a more enterprise-oriented tomcat deploy opposed to the installer approach and feel quite confident in how Alfresco team architected the product to support each companies' unique needs.

Current problem: The FLASH previewer is good, but the challenge with multi-page TIFF is that the tiff2pdf conversion isn't that bad....it's the pdf2swf that is taking 1/4 to 1/2 a second per page.

8 comments:

babagannoush said...

Hi Darren -

I am unable to get tiff (preview or thumbnails) to work with Alfresco 3.4d. (using the default tiff to png conversion)

The log file shows 'Content conversion failed' & 'No decode delegate for this image format'

I am able to run the same command from the prompt and the tiff to png conversion works.

I am thinking that the tiff > pdf> swf solution provided by Fabio should solve both thumbnail and web-preview issues.

I have modified things as per Fabio's post, but share stills seems to performing its default tiff >png conversion.

Is there some other tweak I need to get share to do tiff>pdf>swf?

Thanks.

dhartford said...

Hi Babagannoush,
It sounds like the environment variables (linux: export LD_LIBRARY_*) are not setup/available to Alfresco itself.

One other thing to try is, from the commandline, to try:

"convert -list configure"

There should be a 'DELEGATES' line, and if TIFF isn't there (which, if I recall the 3.4.D install I tested, the default setup did *not* include TIFF), that is the problem is that the imagemagick used by Alfresco (which might be different than your commandline version) is lacking TIFF setup in Imagemagick.

babagannoush said...

Thanks Darren! You are absolutely correct, as mentioned in your post as well, TIFF is not in the DELEGATES line of the Alfresco supplied Imagemagick.

I was trying "convert - list configure" from root which has TIFF in Delegates.

I fixed that by pointing 'img.exe' to '/usr/bin/convert'
my thumbnails work now, but the preview still fails
the log file shows that the pdf file size is 0 (after TIFF >PDF conversion)

It tries to do PDF>SWF with the PDF file but that obviously doesn't work.

Any ideal why my PDF file size is 0, could it be due to syntax error in the command (due to incorrect paths)?

Thanks.

dhartford said...

Glad I could help Babagannoush!

I haven't run into the 0-size PDF (other than one time with a butchered TIFF), but might be able to fix/replace whatever that problem is with the more efficient approach I found (if on linux) by installing 'libtiff' if it isn't already and modify as listed here:

http://fabiostrozzi.eu/2010/10/27/improving-tiff-preview-in-alfresco-share/comment-page-1/#comment-2027

babagannoush said...

Thank you so much Darren! Everything works perfectly now!

I didn't understand what you meant regarding relocating the files to different directory. I kept them as per Fabio's post and it worked.

Thank you very much!

partymix said...

I am getting the below error inside of where the previewer goes:

08:26:53,615 http-80-10 ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 03270010 Failed to process template org/alfresco/components/preview/web-preview.get.html.ftl
org.springframework.extensions.webscripts.WebScriptException: 03270010 Failed to process template org/alfresco/components/preview/web-preview.get.html.ftl


Do you have any thoughts with this? I get this when I change the web-preview-min.js to add the conditional statement he suggests: if (this.options.mimeType.match(/^image\/tiff$/)) u = o; else

And then also adding the two .xml files and the .properties file in the location he suggests. (I also tried all three in the location that you suggested iwth the names you suggested)

I seem to be having issues :( Any thoughts? I am using alfresco 3.4d and imagemagick 6,6,3,10

partymix said...

nevermind i just replaced the whole viewer with one that doesn't conver the image and can read multipage tiff-
Thanks

partymix said...

nevermind i just replaced the whole viewer with one that doesn't conver the image and can read multipage tiff-
Thanks