ImageMagick: watermark filter not working

Author Message

olagato olagato

Thursday 17 January 2008 10:22:47 am

Hi,

On one hand I have in "image.tpl" :
{attribute_view_gui attribute=$object.data_map.image image_class=medium}
This displays correctly an image class=medium

On the other hand I have in "settings\siteaccess\esl\image.ini.append.php" :
[medium]
Reference=
Filters[]
Filters[]=-watermark 100% -gravity center /design/ezwebin_site/images/my_logo.png

This filter doesnt work but so others like:
Filters[]=geometry/scaledownonly=300;300
Filters[]=centerimg=100;100
Filters[]=border/color=200;100;10
Filters[]=border=2;2

Any ideas to try the "watermark" filter on the image ?

Maxime Thomas

Monday 21 January 2008 3:06:55 am

Hi,

If you activate the debug, clear the caches and refresh your page, have you got some error in the debug list ?

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

olagato olagato

Tuesday 22 January 2008 9:09:10 am

a ) Watermark image = design/ezwebin_site/images/my_logo.png
b ) Background image = photo-800x600.jpg ( class = medium )

******************** TEST 1: ***************************
At "settings\siteaccess\esl\image.ini.append.php", an alias "marcagua" is defined and then applied to "class=medium" images:

Filters[]=marcagua=-watermark 100% -gravity center /design/ezwebin_site/images/my_logo.png

[medium]
Reference=
Filters[]
Filters[]=marcagua

The debug shows this output (2):

1.1- Warning: eZImageShellHandler::convert
Failed executing: ""C:\WINDOWS\ImageMagick\convertim.exe" "-quality" "100" "-watermark" "100%" "-gravity" "center" "/design/ezwebin_site/images/my_logo.png" "var/ezwebin_site/storage/images/media/images/photo-800x600/997-1-esl-ES/photo-800x600.jpg" "JPEG:var/ezwebin_site/storage/images/media/images/photo-800x600/997-1-esl-ES/photo-800x600_medium.jpg"", Error code: 1

1.2- Error: eZImageManager::createImageAlias
Failed converting var/ezwebin_site/storage/images/media/images/photo-800x600/997-1-esl-ES/photo-800x600.jpg to alias 'original' in directory 'var/ezwebin_site/storage/images/media/images/photo-800x600/997-1-esl-ES'

******************** TEST 2: ***************************
At "settings\siteaccess\esl\image.ini.append.php", watermark filter is directly applied to "class=medium" images:
Filters[]=-watermark 100% -gravity center /design/ezwebin_site/images/my_logo.png

this displays next message:
2.1- Warning: eZImageManager::convert
The filter '-watermark 100% -gravity center /design/ezwebin_site/images/my_logo.png' is not supported by any of the image handlers, will ignore this filter

olagato olagato

Thursday 24 January 2008 5:00:11 am

I have got the "watermark" filter working but not in the way I would like.
Our ImageImagick version didn't support "-watermark" method so I had to use "-composite" instead:

At "settings/image.ini" I wrote this line:
Filters[]=marcagua=-composite -gravity center design/ezwebin_site/images/my_logo.png

At "settings\siteaccess\esl\image.ini.append.php" these lines:
[ImageMagick]
Filters[]=marcagua=-composite -gravity center design/ezwebin_site/images/my_logo.png

[medium]
Reference=
Filters[]
Filters[]=geometry/scaledownonly=300;300
Filters[]=marcagua

However the image displayed is wrong because it shows the "background image" but with the size of "my_logo.png". Maybe the filter's syntax is wrong.
Any idea would be appreciated.

olagato olagato

Tuesday 26 February 2008 9:05:16 am

SOLVED !!!

ImageMagick's "swap" command was the solution:

At "extension\ezwebin\design\ezwebin\override\templates\full\event.tpl" I wrote this:

{attribute_view_gui attribute=$node.data_map.image image_class=medium lightbox_class=large}

"image_class=medium" is the style for the thumbnail image
"lightbox_class=large" is the style for the big image with lightbox (clicked image)

At "settings\siteaccess\esl\image.ini.append.php" I wrote this:

[ImageMagick]
Filters[]=pictoric_watermark=+swap -charcoal 1 -compose Multiply -gravity northeast -resize 60% -composite design/ezwebin_site/images/logo.png

Filters[]=watermark_resize_60=+swap -compose Multiply -gravity northeast -resize 60% -composite design/ezwebin_site/images/logo.png

Filters[]=watermark_resize_100=+swap -compose Multiply -gravity northeast -composite design/ezwebin_site/images/logo.png

[medium]
Reference=
Filters[]
Filters[]=watermark_resize_60

[large]
Reference=
Filters[]
Filters[]=watermark_resize_100

Nicolas BASTIAN

Wednesday 21 May 2008 1:58:29 am

RESOLVED

<?php /* #?ini charset="iso-8859-1"?

[ImageMagick]
Filters[]=watermark=+swap -composite -gravity center /var/www/ez_site/extension/design/ez_site/images/watermark.png

[MIMETypeSettings]
Quality[]
Quality[]=image/jpeg;85

[AliasSettings]
AliasList[]=watermark_thumb

[watermark_thumb]
MIMEType=image/jpeg
Reference=
Filters[]
Filters[]=geometry/scaledownonly=655;485
Filters[]=watermark=

*/ ?>

laurent le cadet

Monday 14 June 2010 9:12:30 am

Hi,

4.3.0
I tried this :

[ImageMagick]
Filters[]=watermark=-compose Multiply -gravity northeast -resize 60% -composite /extension/ezwebin/design/ezwebin/images/watermark.png

[lightbox]
Reference=
Filters[]
Filters[]=geometry/scaleheight=600
Filters[]=watermark=

But can't make it work.

The image is not generate.

I use this with lightbox, but i don't think it's important as we just ask for image alias.

Any help will be appreciated.

Laurent

Guillaume HH

Saturday 19 March 2011 1:23:39 am

HI,

I use this filter

Filters[]=watermark=-gravity SouthEast -pointsize 16 -draw 'fill #cd0202 text 10,10 "© your copyright text here"'

That writes your text on picture in red.

It's quicker an easier to write text on picture than merge two images into one :-)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:04:09
Script start
Timing: Jan 18 2025 11:04:09
Module start 'layout'
Timing: Jan 18 2025 11:04:09
Module start 'content'
Timing: Jan 18 2025 11:04:10
Module end 'content'
Timing: Jan 18 2025 11:04:10
Script end

Main resources:

Total runtime1.0780 sec
Peak memory usage4,096.0000 KB
Database Queries78

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 589.1641152.6406
Module start 'layout' 0.00620.0031 741.804739.4766
Module start 'content' 0.00931.0672 781.2813748.8047
Module end 'content' 1.07650.0014 1,530.085920.1250
Script end 1.0779  1,550.2109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2878160.0002
Check MTime0.00130.1192160.0001
Mysql Total
Database connection0.00090.080010.0009
Mysqli_queries0.973790.3235780.0125
Looping result0.00090.0876760.0000
Template Total1.048397.220.5241
Template load0.00210.191620.0010
Template processing1.046297.051420.5231
Template load and register function0.00010.013410.0001
states
state_id_array0.00080.073410.0008
state_identifier_array0.00110.103920.0006
Override
Cache load0.00190.17521120.0000
Sytem overhead
Fetch class attribute can translate value0.00070.063650.0001
Fetch class attribute name0.00170.1623110.0002
XML
Image XML parsing0.00700.645750.0014
class_abstraction
Instantiating content class attribute0.00000.0032140.0000
General
dbfile0.00560.5191280.0002
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
30content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
23content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 72
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs