cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[2.0.0] Image Adapter resize omitted values now required?

Open alphanyx opened this issue 11 years ago • 2 comments

I want to resize some Images with Phalcon 2.0.0.

I use the Image Magick Adapter \Phalcon\Image\Adapter\Imagick

With this Code everything works fine:

$image->resize($width, $height);

But it resizes my Images fix to 80x80. I want to proportionally resize the Image. So i check wether height or width is larger and set the correct variable to null

In the Documentation is this written:

public Phalcon\Image\Adapter resize ([unknown $width], [unknown $height], [unknown $master]) inherited from Phalcon\Image\Adapter
/**
 * Resize the image to the given size. Either the width or the height can be omitted and the image will be resized proportionally.
 *
 */

I didn't tried this in the Previous Version (1.3.4) but it seems that this line isn't correct anymore. When i set $width to null i get this error:

$image->resize(null, $height);

width and height must be specified

Is it a bug or how do i resize the image proportionally?

BTW: It seems like http://docs.phalconphp.com/en/master/api/Phalcon_Image_Adapter_Imagick.html is showing the Documentation for v1.3.0 When i take a look at http://docs.phalconphp.com/en/latest/api/Phalcon_Image_Adapter_Imagick.html (Documentation for v2.0.0) there is no note about omitting one argument.

EDIT: Similiar Problem like #9965

alphanyx avatar Apr 27 '15 12:04 alphanyx

This should be fixed in the next update. Check #10184

agim-a avatar Apr 27 '15 16:04 agim-a

@andresgutierrez Fixed in #10184.

Green-Cat avatar May 26 '15 10:05 Green-Cat