Friday 20 November 2009 5:20:41 am
One solution is to use PostParameters to round the corners of *ALL* images. This is because the PostParameters setting isn't escaped onto the command line, as are the Filters. I couldn't get the ImageMagick command line options used for rounding to pass properly through the escaping using Filters. Formats that don't support transparency don't display the rounded corners, thus, .jpgs are unchanged, unless you choose to use one of the 'rounded' aliases. ez/settings/override/image.ini.append.php <?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 */ ?> I modified /var/www/html/ez/lib/ezimage/classes/ezimageshellhandler.php to place the Filters and PostParameters between the source and destination filenames, because this is how I usually work with ImageMagick. /var/www/html/ez/lib/ezimage/classes/ezimageshellhandler.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']; Finally, although I tried to use the debug settings to output the commandline, I didn't have any luck. To support development, I added the following line to the same file: file_put_contents('/tmp/eZ.out',$systemString."\n",FILE_APPEND);
/* Added just before the execution */ system( $systemString, $returnCode );[/
|