Re: [PEPr] Images::Imagick proposal, Conjure conjunction
| From: | Florent Monnier | Date: | Mon, 03 May 2004 22:47:15 +0000 |
| Subject: | Re: [PEPr] Images::Imagick proposal, Conjure conjunction | ||
| References: | 1 | Groups: | php.pear.dev php.pear.dev php.pear.dev php.pear.dev |
| Request: | Send a blank email to pear-dev+get-28744@lists.php.net to get a copy of this message | ||
> proposal: http://pear.php.net/pepr/pepr-proposal-show.php?id=64
>
> I also hope to get some input on "Image_Magick_Conjure" by Florent Monnier.
> He doesn't use a PEAR-Imagick-Api right now and it would be nice to get
> together somehow.
===========
Can I make changes in this package to make it fit both,
how I think IMHO a PHP-IM class should be,
and to get it integrated with IM_Conjure ?
If I make deep changes in the naming and others minor points like this,
will you mind it?
However, all is discussable ;-)
_____
And now, for the details of linking with IM_Conjure,
what about the suggestion of Alan for the magick underlaying calls?
reminder (abbr):
$im = new IM;
$im->anyFilter(array(
'paramFoo' => 3,
'paramBar' => 12,
));
I totaly agree with this suggestion.
(I've thought about doing this yet, but did not because there has other points
I thought that sould be done before, but it seems that's now or never)
But the question will then be, if we all agree on this point, that
If the weird pear::IM names are kept there should be an array for
corespondence with standard IM names to call this class:
$im->{$correspondence[$stdIM_name]}(array(
'paramSome' => 3,
'someParam' => 12,
));
Ok let's call_user_method_array() to give the parameters, but how to sort the
hach array from the MSL parsing, to fit into a numeric array where parameters
should be given in the correct order?
What would be the proper solution?
Orig:
function addWaveFilter($iAmplitude = 1, $iFrequenzy = 1)
{
if (!imagick_wave($this->_rHandle, $iAmplitude, $iFrequenzy)) {
return $this->_createError(IMAGE_IMAGICK_ERROR_SFX_FAILED);
}
return true;
}
Suggestion:
function wave($params = array('amplitude' => 2, 'wavelength' => 4))
{
if (!imagick_wave($this->_rHandle,
$params['amplitude'],
$params['wavelength'])) {
return $this->_createError(IMAGE_MAGICK_ERROR_FAILED_SFX);
}
return true;
}
This one would be just perfect for Conjure as Alan Knowles suggested,
but what about a direct call? Wouldn't it be a disadvantage?
Best Regards