Hello,
I try to add a new function to the Image class which will flip an image horizontally, vertically or both. It should work exactly the same way like SetRatioSize only with an additional parameter.
I added the following Code to the Image class as a first tryout:
public function SetFlipImage($width, $height, $type) {
return $this->getFormattedImage('SetFlipImage', $width, $height);
}
public function generateSetFlipImage(GD $gd, $width, $height, $type){
return $gd->resizeRatio($width, $height);
}
But when calling from Template with $Image.SetFlipImage(248,123,hor) Silverstripe stops with:
[Warning] Missing argument 1 for Image::SetFlipImage(), called in /public_html/silverstripe_base/sapphire/core/ViewableData.php on line 369 and defined
That I do not understand, because removing the last argument leads to
[Warning] Missing argument 3 for Image::SetFlipImage()
which is absolutely correct. Why does Silverstripe not recoginize my third parameter?