Thursday 16 December 2010 1:06:38 am
I'm using the eZDFSFileHandler and each time that I try to apply a watermark image located in extension/ezie/design/standard/images/watermark, it automatically get deleted and the 'tool_watermark' view returns a 503 response code telling that this image doesn't exist. I found that is due you are treating this file as a clusterized one. I show the working code below:
<code>
<?php
class eZIEImageToolWatermark extends eZIEImageAction
{
public static function filter( $region, $image )
{
$bases = eZTemplateDesignResource::allDesignBases();
$triedFiles = array();
$fileInfo = eZTemplateDesignResource::fileMatch( $bases, false, "images/watermarks/$image", $triedFiles );
if ( !$fileInfo ) {
print json_encode(array(
'error' => "watermark image '$image' doesn't exist in any design"
));
eZExecution::cleanExit();
}
$img_path = eZSys::rootDir() . '/' . $fileInfo['path'];
// retrieve image dimensions
$analyzer = new ezcImageAnalyzer( $img_path );
// percentage of the watermark original size to use
$pc = $region['w'] / $analyzer->data->width;
return array(
new ezcImageFilter(
'watermarkAbsolute',
array(
'image' => $img_path,
'posX' => $region['x'],
'posY' => $region['y'],
'width' => intval( $region['w'] ),
'height' => intval( $region['h'] )
)
)
);
}
}
?>
</code>
As you can realise, I also have added support to put the watermark in any registered design, and not only inside the extension.
Monday 10 January 2011 3:06:15 pm
Hi Romeo!
I'm sorry to say that this was the only thing I did to get it work. My version of eZ is 4.2.0 and the version of ezie is 1.0.
Also note that ezie demands PHP 5.2 and higher otherwise I'm not sure it will work...
Good Luck!
/Anja Lundin, Novitell AB
Monday 19 December 2011 3:06:10 pm
Hi,
I would like to add cropping presets to a pulldown menue for cropping size presets in the right sidebar above the pixel ratio input fields.
The goal: the editor only uses certain image sizes throughout the site. Instead of selecting the correct size manually, he/she could use a predefined 300x200px size from the pulldown, which sets the cropping selction to the right size.
Is there a way to extend ezie for this purpose in a clean, upgradable way?
Thanks!
Monday 23 August 2010 5:11:34 pm
...wasn't working until I commented out line 25 in ezie/modules/ezie/prepare.php
<code>
die( '// @todo fixme
' );
</code>
If someone else is having the same problem. I use ezie with eZ 4.3.0.
This is a great extension. Many thanks!
/Anja Lundin, Novitell AB
Monday 23 August 2010 5:11:35 pm