image with fixed width/height proportion

Author Message

Jacek S

Thursday 13 July 2006 10:41:55 am

Is it possible to configure image object in ez publish that will have a fixed width/height proportion?
For example i want to configure my article class(with image) in such way that it could only accept image file with 3:4 proportion(ex. 600 x 800 px).

Ɓukasz Serwatka

Thursday 13 July 2006 11:41:59 pm

You can define new image alias with fixed size in your override image.ini file. Then use new image alias in template.

{attribute_view_gui attribute=$node.object.data_map.image image_class=your_new_alias}

<i>
For example i want to configure my article class(with image) in such way that it could only accept image file with 3:4 proportion(ex. 600 x 800 px).
</i>

This is not possible by default. You can't force checking image dimensions during upload. This will require some PHP coding: new datatype or hacking existing for additional validation.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Christian Johansen

Friday 14 July 2006 12:26:57 am

It is not exactly what you ask for, but you may scale down to a minimum width and height, then crop the image to a given proportion. That usually works for me

Marcin Drozd

Friday 14 July 2006 7:12:51 am

Hi Christian
Just a little question:
<i>scale down to a minimum width and height, then crop the image to a given proportion</i>
did U add in image.ini ex:
[ImageMagick]
Filters[]=geometry/scaleandcrop=-geometry %1x%2> -crop %3x%4+%5+%6
??
thanks

http://ez-publish.pl

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

Main resources:

Total runtime0.5696 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 590.4219152.6406
Module start 'layout' 0.00460.0027 743.062539.4766
Module start 'content' 0.00730.5611 782.5391613.4453
Module end 'content' 0.56840.0012 1,395.984412.1250
Script end 0.5696  1,408.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.5193160.0002
Check MTime0.00120.2192160.0001
Mysql Total
Database connection0.00060.106710.0006
Mysqli_queries0.524892.1323640.0082
Looping result0.00060.1107620.0000
Template Total0.544095.520.2720
Template load0.00170.296720.0008
Template processing0.542395.206020.2712
Template load and register function0.00010.024210.0001
states
state_id_array0.00060.111810.0006
state_identifier_array0.00120.207420.0006
Override
Cache load0.00140.2482240.0001
Sytem overhead
Fetch class attribute can translate value0.00110.190440.0003
Fetch class attribute name0.00100.175650.0002
XML
Image XML parsing0.00080.148840.0002
class_abstraction
Instantiating content class attribute0.00000.001350.0000
General
dbfile0.00080.1413180.0000
String conversion0.00000.001440.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs