cancel
Showing results for 
Search instead for 
Did you mean: 

Image manipulation in WCM: is it possible?

maephisto
Champ in-the-making
Champ in-the-making
Hi,
is it possible to have image manipulation in WCM? I mean, someone could upload an image through the filepicker and after submitting the new content the image could be manipulated by imagemagick.

Let's imagine a logo picture: this could be present in the header and in the footer of a html page. The one in the header should have a fixed size (let's call it the bigger one), while the one in the footer should be the smaller one: they are the same image (the same thing from a content point of view) but they are just rendered in different ways.

thx in advance
3 REPLIES 3

kvc
Champ in-the-making
Champ in-the-making
Maephisto:


Great post.  Few things here:

1.  Typically, you will want to use an Alfresco for your creative team to
     create and manage digital assets.  They can use a custom view of that
     space that provides a thumbnail view of assets (available via a
     contributed Forget project).  That space can be configured with a
     content rule to execute whatever custom imagemagick transformations
     you need.  Transformed assets should use a simple workflow for
     approval, and then place them in another space, which would be
     essentially your Digital Asset Library of approved corporate assets.

2.  End-users can browse this digital library and using the clipboard
     copy and paste any number of assets they want into their web
     project.  Then, they can create content using a form and reference.
     In the ideally world we'd allow them to browse regular spaces to
     statically reference fixed assets in the library or import into the
     web project; we don't enable that now, although it is a to-do.

3.  End-users alternatively can use the file-picker to upload a new
     image in their web project, which they can upload directly from
     the digital asset library presuming they have a CIFS mounted drive.
     This would be a workaround for the last point above in #2.

Now, you can also just put digital assets in a web project and use imagemagick.  Because web project folders do not yet support rules ala spaces, instead of writing a rule to call imagemagick for transformation, you'd instead configure a workflow to match on a particular file-extension and have a custom workflow that implemented a custom action to invoke imagemagick.  What's nice about this is that in your custom workflow you can have a start task that captures on the transformation parameters a business user might want for an asset, and then at submit time have all the appropriate renditions generated in a reviewer's sandbox for potential  approval.  This puts more power in the hands of business users to specify what types of transformations they want on an asset when uploading into the system, and is a great use of our advanced workflow, sandboxes, and imagemagick engine.

A last way to do this is to capture the transformation options for a referenced asset directly in the web form itself.  Then, in your Freemarker template, when you transform the XML, have a custom call-out to imagemagick passing the transformation parameters captured within the form data so that the generated page has exactly the image you need.  This is probably the best solution ultimately - that way, business users can each reference the same asset, but for different business users when accessing the form they can specify things like whether they want it in black or white, 100'x200' or 200'x300', etc.

So, a few options available to you.  Really, all are completely valid and have different merits in different situations.  We intend to have all of these options supported in the client in the future.  The benefit of a system like Alfresco is that is very flexible; I guess the corresponding downside is that because we don't out of the box present just one way of doing things, it can be a bit of a barrier for proof-of-concepts.  Like I said, we will address this … it's the proverbial issues of time and resource …

Kevin

maephisto
Champ in-the-making
Champ in-the-making
Great answer  Smiley Surprised

You gave me many ideas. I'll try to achieve transformation through the last solution you suggested: the callout from Freemarker. From my point of view, the user who inserts content (content contributor) shouldn't be aware of parameters about transformation of content, above all when this transformation is related with presentation layer. In the logo example, I (web designer) could change the Freemarker template maybe with different image transformation parameters: from a content point of view the content contributor shouldn't notice any change.

maephisto
Champ in-the-making
Champ in-the-making
I was reading Freemarker documentation and now I have a new question. What did you mean with "custom call-out to imagemagick"? I thought in Freemarker there was the possibility to call a shell command, but I believe I was wrong: the only thing I could find was macro or transform directives. Through transform I can call the functions of a Java object that will call imagemagick: did u mean this or I am on the wrong way?

Thx