Forums / Setup & design / image with fixed width/height proportion

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