GD Adaptor Image resize & crop

I'm triying to resize and crop an image with the Phalcon\Image\Adapter\GD https://docs.phalconphp.com/en/master/api/Phalcon%5Image%5Adapter%5GD.html

The docs says

Resize the image to the given size. Either the width or the height can be omitted and the image will be resized proportionally.

but I tried with null and 0 on the first parameter and an exception is throw:

width and height must be specified



60.9k

only resize allows null as a parameters, is that how you use it ?

can we see the code ?

edited Sep '15
    public function testsAction()
    {
        try {
            $image = new Phalcon\Image\Adapter\Gd('absolute_path_on_server');
            $image->resize(null, 800);
            $image->save();
        } catch (\Exception $e) {
            $this->flash->error($e->getMessage());
        }
    }

throws width and height must be specified

$image->resize(null, 800);

You're trying to resize to Width = null, so it's throwing you the error. You need 2 values for your resize function adn they can't be null values : _resize (mixed $width, mixed $height)