Nutshell explanation:
Make these changes to allow rounded image corners under eZ publish.
All .gifs and .pngs will have their corners rounded.
No .jpgs will have their corners rounded, unless you use the rounded aliases below, which force the output type to .png.
ez/settings/override/image.ini.append.php settings
Code:
<?php /* #?ini charset="utf-8"? | |
| |
[AliasSettings] | |
AliasList[]=rounded-small | |
AliasList[]=rounded-medium | |
AliasList[]=rounded-large | |
| |
[rounded-small] | |
MIMEType=image/png | |
Reference=small | |
| |
[rounded-medium] | |
MIMEType=image/png | |
Reference=medium | |
| |
[rounded-large] | |
MIMEType=image/png | |
Reference=large | |
| |
[ImageMagick] | |
IsEnabled=true | |
ExecutablePath=/usr/local/bin | |
Executable=convert | |
ExecutableUnix=convert | |
| |
# This line causes ALL images to have their corners rounded. Only .gifs and .pngs will display with rounded corners, .jpgs | |
# will display with sharp corners, because they don't support transparency. If a .jpg image is uploaded, the display class | |
# must be set to one of the above for the rounded corner version to display. | |
# | |
# The PostParameters settings must also be applied before the destination file name, modify /var/www/html/ez/lib/ezimage/classes/ezimageshellhandler.php | |
# | |
# Thanks to: http://www.imagemagick.org/Usage/thumbnails/#rounded | |
PostParameters=\( +clone -threshold -1 -draw "fill black polygon 0,0 0,10 10,0 fill white circle 10,10 10,0" \( +clone -flip \) -compose Multiply -composite \( +clone -flop \) -compose Multiply -composite \) +matte -compose CopyOpacity -composite | |
| |
*/ ?> |
/var/www/html/ez/lib/ezimage/classes/ezimageshellhandler.php
PHP:
if ( $filters !== false ) | |
{ | |
foreach ( $filters as $filterData ) | |
{ | |
$argumentList[] = $this->textForFilter( $filterData ); | |
} | |
} | |
| |
/* Move PostParameters up before the destination file is named */ | |
if ( $this->PostParameters ) | |
$argumentList[] = $this->PostParameters; | |
| |
$destinationURL = $destinationMimeData['url']; |
… same file … to help you see the command being executed …
PHP:
file_put_contents('/tmp/eZ.out',$systemString."\n",FILE_APPEND); | |
system( $systemString, $returnCode ); |