center image - resize

Author Message

Andreas Kaiser

Friday 16 May 2008 1:45:10 am

Hello,

In one template I need to create automatic images with a 198x159px size. These images will contain logos, so they shouldn't be cropped. The idea is to reduce the original image and then crop the image. A similar situation was posted here:

http://ez.no/developer/forum/setup_design/image_filters/re_image_filters

I've tried the code:

[AliasSettings]
...
AliasList[]=flash_logo

[ImageMagick]
...
Filters[]=thumb=-resize 'x%1' -resize '%1x<' -resize 50%
Filters[]=centerimg=-gravity center -crop %1x%2+0+0 +repage

[flash_logo]
Reference=
Filters[]
Filters[]=thumb=400
Filters[]=centerimg=198;159

but it didn't work (no image was shown). Any ideas?

eZ Partner in Madrid (Spain)
Web: http://www.atela.net/

Felix Laate

Friday 16 May 2008 2:43:48 am

Hi Andreas,

I use the same, but with one more filter:

[ImageMagick]
...
Filters[]=strip=-strip

[smallpic]
...
Filters[]=strip=

This works for me at least.

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

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 31 2025 03:44:49
Script start
Timing: Jan 31 2025 03:44:49
Module start 'layout'
Timing: Jan 31 2025 03:44:49
Module start 'content'
Timing: Jan 31 2025 03:44:49
Module end 'content'
Timing: Jan 31 2025 03:44:49
Script end

Main resources:

Total runtime0.0252 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.1328151.2109
Module start 'layout' 0.00540.0041 739.3438220.6875
Module start 'content' 0.00950.0140 960.0313997.8359
Module end 'content' 0.02350.0017 1,957.867229.9922
Script end 0.0252  1,987.8594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002811.1443140.0002
Check MTime0.00114.5471140.0001
Mysql Total
Database connection0.00093.695210.0009
Mysqli_queries0.00249.429230.0008
Looping result0.00000.177910.0000
Template Total0.00124.910.0012
Template load0.00093.723610.0009
Template processing0.00031.159510.0003
Override
Cache load0.00072.647410.0007
General
dbfile0.00176.554780.0002
String conversion0.00000.031240.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