Image Conversion on the fly

Image Conversion on the fly

Wednesday 27 October 2010 7:31:20 pm - 3 replies

Author Message

Romeo Antony

Thursday 28 October 2010 12:13:59 am

Hi Raghu , Warm welcome to ez community.

for image manipulation you can use GD or image magic. Try searcgin on ez forums about image magic .

try to read this file ezdir/settings/image.ini.php file.

Also read explore ezdir/settings/siteaccess/yourmobsite/image.ini.append.php

An example to resize images are

like below

{attribute_view_gui attribute=$node.data_map.image image_class="mobile_handset"}

/* configure the alias array in image.ini in your mobile site accesss */

AliasList[]=mobile_handset

/* define the configuaration block *

[mobile_handset]
Reference=
Filters[]
Filters[]=geometry/scaledownonly=210;190
Filters[]=geometry/crop=200;180;0;0

so in above you wll see the the ezimage property scale into width, height 210px,190px.

and crop the image to 200,180.

u can define any properties that image magic support in your site access image.ini or global override.

read on read on about ezp.

Regards

Romeo

Nicolas Pastorino

Thursday 28 October 2010 1:44:23 am

Hi Raghu,

Building off what Romeo explained, eZ Publish is able to use both imagemagick and GD for processing images. This needs to be configured in image.ini, and can be done per siteaccess. This also applies to the various image sizes and filters (called 'aliases' in the eZ Publish terminology).

One can imagine that one siteaccess is created per mobile handset type, where the content of image.ini slightly varies to match the handset's screen capabilities.
Another option would be to have one single siteaccess for all types of mobile devices, but place the discriminating logic within the templates themselves : when displaying an image, and provided you have at disposal the type of device currently requesting the page, you can pass different values for the image_class parameter (synonym of 'alias' here ):

{switch match=$deviceType}     
    {case match='iphone'}        
        {attribute_view_gui attribute=$node.data_map.image image_class="small_iphone"}    
    {/case}     
    {case match='htcdesire'}
        {attribute_view_gui attribute=$node.data_map.image image_class="small_htcdesire"}    
    {/case}
    {case}
        {attribute_view_gui attribute=$node.data_map.image image_class="small_mobile"}    
    {/case}
{/switch}

Which could be simplified into (just occured to me), in case $deviceType information is properly normallized :

{attribute_view_gui attribute=$node.data_map.image image_class=concat( "small_", $deviceType )}

Let us know how you are grasping this part of eZ,
Cheers,

PS : You may find this useful : http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Configuration-files/image.ini

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Raghu Rao

Monday 01 November 2010 2:52:27 pm

Thanks guys, will look into it and i guess come back with more questions :-)

Cheers

R

You must be logged in to post messages in this topic!

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