eZ Community » Forums » eZ Publish 5 Platform » Manipulate image variation
expandshrink

Manipulate image variation

Manipulate image variation

Sunday 16 December 2012 9:00:24 pm - 9 replies

Hello guys,

Do you have any example on how to manipulate image variation ? 

In the value of an image field there is no information about these variation. 

It looks like there is a variation service but when you are in twig template is there an easy way to access variations ? 

Thanks

Sunday 16 December 2012 9:32:33 pm

Hi Matthieu..

You mean on ez5 right ? blunk.gif Emoticon Yes image variation are easy on twig template .. you have access to ez_image_alias. 

Constructor looks like :
ez_image_alias( Field, VersionInfo, variation)

I ll this week write a tutorial on how to fetch an image variation via controller too blunk.gif Emoticon

 

Cheers

Philippe

Modified on Sunday 16 December 2012 9:35:37 pm by Philippe Vincent-Royol

Monday 17 December 2012 9:07:47 am

Great thank you Philippe ! 

The problem is that I get an odd behaviour, I have an exception in the AliasGenerator because the aliasArray return by the legacy handler is null :

 $aliasArray = $imageAliasHandler->imageAlias( $variationName );

The reason is that the aliasList method of the legacy ezimagealiashandler return constantly only the original alias, on the other hand the aliasList of the ezimagemanager return the good list of alias.

Did you get this working ? I am running the last community build. 

Thanks

Monday 17 December 2012 9:54:32 am

Hi Matthieu,

I didn't try eZ CE (only git version but quite the same ) I had a similar problem, because my variation was not describe on ezpublish/config/ezpublish.yml. Try to check your configuration file

Cheers

Philippe

Sunday 20 January 2013 6:44:06 pm

Hello,

I finally had time to look back at this problem. I did succeed in generation image alias by change this settings to false in ezpublish.yml : 

imagemagick:
    enabled: false 

If this settings is true, the method convert() in ezimagemanager is failing, I don't really get why this behaviour. 

In your case do you have imagemagick enabled in eZ 5 ?

Monday 21 January 2013 11:39:15 am

Maybe the path to your imagemagick binary is not correct.

Example:

imagemagick:
    enabled: true
    path: /opt/local/bin/convert

Modified on Monday 21 January 2013 11:39:50 am by Jérôme Vieilledent

Monday 21 January 2013 11:56:30 am

Nope, I checked it and its the same on legacy too.

What is the expected behaviour when we switch the enabled config to false ? It uses another library ?

I tried to have a look at the convert() method in legacy to see why it's failing but the method is quite complicated happy.gif Emoticon 

Monday 21 January 2013 1:15:08 pm

When you switch off ImageMagick, GD is used.

Saturday 09 February 2013 1:43:25 pm

I finally got what's wrong and It was linked to my imagick install, sorry guys for the time lost ... 

Now it works like a charm, good job Jérôme ! 

Monday 18 March 2013 4:50:20 am

The reply has been removed because of violation of forum rules.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from