This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » eZ Publish 5 Platform » Custom Imagemagick Filters
expandshrink

Custom Imagemagick Filters

Custom Imagemagick Filters

Monday 15 April 2013 2:15:21 pm - 10 replies

In ezpublish.yml, how do you define custom imagemagick filters?

I tried this but it didnt seem to work..

ezpublish:
 system:
 nor:
 legacy_mode: true
 image_variations:
 referencelarge:
reference: null
 filters:
 - { name: thumb, params: [820] }
 - { name: centerimg, params: [661, 406] }
 - { name: sharpen, params: [] }
 imagemagick:
 enabled: true
 path: /usr/bin/convert
 filters:
 thumb: "-resize {%1x<} -resize {50%} -quality 90"
 centerimg: "gravity center -crop {1}x{2}+{0}+{0} +repage"
 sharpen: "-sharpen 0.5"
 http_cach:
 purge_type: local 

 

Any ideas?

Monday 15 April 2013 2:27:28 pm

I see that your siteaccess nor has legacy mode enabled, it means that you're entirely based on legacy stack. Though you should try to create your image alias in legacy (in image.ini).

 

Cheers

Monday 15 April 2013 2:34:04 pm

Hi there.

Yes, its true that im running legacy mode. The reason im trying this is because during the upgrading of 4.7 to 5.0 the sitemapping was generated in ezpublish.yml, together with the standard imagealiases. The customfilter was for some reason excluded. Its still declared in settings/override/image.ini.append.php, but doesn't seem to work from there either, like this (unchanged from 4.7):

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

Any ideas of why it didnt get ported to ezpublish.yml like the rest of the aliases, or why it doesnt kick in from image.ini.append.php?

Tuesday 16 April 2013 9:21:27 am

Hello,

To define a new filter on eZ 5, you have to do something like in default_settings.yml file (located at eZ\Bundle\EzPublishCoreBundle\Resources\config\default_settings.yml)

For that edit your services.yml file or parameter.yml file and put something like this:

 ezpublish.image.imagemagick:
    sharpen: "-sharpen 0.5"
    centerimg: "-gravity center -crop {1}x{2}+0+0 +repage"

And so on.. 

Cheers 

Tuesday 16 April 2013 10:31:52 am

Philippe: Warning, if you do that you'll erase all existing filters !!!

Harald: Which eZ Publish version are you running ? You're probably experiencing this issue (recently fixed)

Tuesday 16 April 2013 10:57:24 am

Im running 5.0 in legacy mode, unfortunately..

Modified on Tuesday 16 April 2013 10:58:29 am by Harald Tollefsen

Tuesday 16 April 2013 11:09:00 am

Then you can use the workaround provided by Philippe, but be cautious as it will remove all existing filters. So don't forget to also copy default filters.

Tuesday 16 April 2013 11:11:10 am

Okey, thanks! I'll try it out within a few days.

Monday 22 April 2013 3:19:19 pm

Where should i rewrite the default filters (located vendor/ezsystems/ezpublish/eZ/Bundle/EzPublishCoreBundle/Resources/config/default_setting.yml?)?

In ezpublish/config/ezpublish.yml? That file is really starting to build itself up (this site has about 40 siteaccess', maybe more).

 

In short: Should i define everything in ezpublish.yml, and in which order?

Monday 22 April 2013 3:22:25 pm

Quote from Support Netmaking :

Where should i rewrite the default filters (located vendor/ezsystems/ezpublish/eZ/Bundle/EzPublishCoreBundle/Resources/config/default_setting.yml?)?

In ezpublish/config/ezpublish.yml? That file is really starting to build itself up (this site has about 40 siteaccess', maybe more).

 

In short: Should i define everything in ezpublish.yml, and in which order?

Its me, I just logged in on the wrong account..

Monday 22 April 2013 3:42:45 pm

I finally got it to work by defining everything in ezpublish/config/parameters.yml

Modified on Monday 22 April 2013 3:43:49 pm by Harald Tollefsen

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from