Custom image filter

Author Message

Joanna Grzegorczyk

Monday 26 January 2009 5:45:15 am

GD have some predefined filters such as:

geometry/scalewidth
geometry/scaleheight
geometry/scaledownonly
geometry/scalewidthdownonly

Do you know how to add new image filter that will be processed by GD without modifing kernel class?

What I want to do is to crop an image based on coordinates that are stored as image object attributes.

http://ez.no/certification/verify/253200

Noicokuna Niemoge

Monday 26 January 2009 6:55:16 am

If I remember correctly, there's an extension called ezcrop...

http://projects.ez.no/ezcrop/(language)/eng-GB

Maybe it will be helpful?

Shiki soku ze ku...

Joanna Grzegorczyk

Tuesday 27 January 2009 1:11:58 am

The problem is that I also need the original image, that's why I wanted to make different image aliases.

http://ez.no/certification/verify/253200

Michael Fürst

Wednesday 28 January 2009 4:26:07 am

Do you have the image.ini.append.php File in your Site Settings? There you are able to declare Images Classes and use them in your template file.

For example (INI File):
---------------------------------
[articleimage140x100]
Reference=
Filters[]
Filters[]=geometry/scaleheight=120
Filters[]=geometry/scalewidth=140
Filters[]=geometry/crop=140;120;0;10

Usage in Template:
------------------------------
{attribute_view_gui attribute=$valid_nodes.data_map.photos.data_map.image title=$imageTitle alt=$imageAlt image_class='articleimage140x100'}

But I don't know if this works without ezFlow Extension..

Ciao,
Mike

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 16:22:26
Script start
Timing: Jan 18 2025 16:22:26
Module start 'layout'
Timing: Jan 18 2025 16:22:26
Module start 'content'
Timing: Jan 18 2025 16:22:26
Module end 'content'
Timing: Jan 18 2025 16:22:26
Script end

Main resources:

Total runtime0.0147 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.0234152.6250
Module start 'layout' 0.00560.0026 741.648439.4297
Module start 'content' 0.00820.0045 781.078189.2891
Module end 'content' 0.01270.0020 870.367234.3047
Script end 0.0147  904.6719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002617.6938140.0002
Check MTime0.00128.0497140.0001
Mysql Total
Database connection0.00127.826510.0012
Mysqli_queries0.002214.684430.0007
Looping result0.00000.095410.0000
Template Total0.001711.510.0017
Template load0.00095.881210.0009
Template processing0.00085.561010.0008
Override
Cache load0.00064.252810.0006
General
dbfile0.00032.136180.0000
String conversion0.00000.187640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs