Forums / General / Image treatement

Image treatement

Author Message

guiguivts guiguivts

Monday 01 December 2008 3:33:58 am

Hello,

I saw that we can easily resize an image with eZ.

I'd like to know if we can add text over an image ? ( and the result is a new image with the added text)

Bye

Arnaud Lafon

Monday 01 December 2008 4:02:31 am

Hi,

eZpublish is able to use ImageMagick command. Maybe you could use the -caption operator to add this text. You'll need to override the image.ini and add some filters in the [ImageMagick].Filters array and then create an alias that use this filter.

I didn't use kind of filters and don't know If it works, but this would looks like this :

image.ini.append.php


# Adding the new image alias
[AliasSettings]
AliasList[]=mynewalias
...
# Alias settings
[mynewalias]
Filters[]
Filters[]=caption=My text
....
# ImageMagick settings
[ImageMagick]
Filters[]=caption=-caption %1
...

in your template

{attribute_view_gui attribute=$node.data_map.image image_class="mynewalias"}

There are severall convert operator as you can see in http://www.imagemagick.org/Usage/annotating/. Don't know If all can be used in eZpublish.

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

guiguivts guiguivts

Monday 01 December 2008 4:48:04 am

Thks,

In fact, i'd like to create these images dynamically.

What i'd like to do is to create a template which get from an object an image and a text and create from this 2 attributes the result image.

So the text can't be in an ini file.

Bye

Arnaud Lafon

Monday 01 December 2008 5:13:04 am

Then you'll have to create your own template operator which will be called on a image variation and will return a modified image. I think this is quite simple.

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

guiguivts guiguivts

Monday 01 December 2008 5:43:35 am

Ok thanks

I don't know how to create template opertor but i'm going to search in this direction

bye

Arnaud Lafon

Monday 01 December 2008 7:50:39 am

You'll find more information and a simple "how to" at this url : http://ez.no/ezpublish/documentation/development/extensions/template_operator

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com