protected function sourceProperties()
    {
        $properties = Helper::imageProperties($this->source['file'], $this->source['path']);

        if ($properties['width'] !== null) {
            $this->source['width'] = $properties['width'];
            $this->source['height'] = $properties['height'];
            $this->source['aspect_ratio'] = $properties['aspect_ratio'];
        } else {
            throw new \Exception(Helper::ERROR_CALL_GETIMAGESIZE);
        }

        if ($this->canvas['width'] > $this->source['width'] || $this->canvas['height'] > $this->source['height']) {
            throw new \Exception(Helper::ERROR_UPSCALE);
        }
    }
protected function sourceProperties()
    {
        $properties = Helper::imageProperties($this->source['file'], $this->source['path']);

        if ($properties['width'] !== null) {
            $this->source['width'] = $properties['width'];
            $this->source['height'] = $properties['height'];
            $this->source['aspect_ratio'] = $properties['aspect_ratio'];
        } else {
            throw new \Exception(Helper::ERROR_CALL_GETIMAGESIZE);
        }

        if ($this->canvas['width'] > $this->source['width'] || $this->canvas['height'] > $this->source['height']) {
            throw new \Exception(Helper::ERROR_UPSCALE);
        }
    }
protected function sourceProperties ( ) { $ properties = Helper :: imageProperties ( $ this -> source [ 'file' ] , $ this -> source [ 'path' ] ) ; if ( $ properties [ 'width' ] !== null ) { $ this -> source [ 'width' ] = $ properties [ 'width' ] ; $ this -> source [ 'height' ] = $ properties [ 'height' ] ; $ this -> source [ 'aspect_ratio' ] = $ properties [ 'aspect_ratio' ] ; } else { throw new \ Exception ( Helper :: ERROR_CALL_GETIMAGESIZE ) ; } if ( $ this -> canvas [ 'width' ] > $ this -> source [ 'width' ] || $ this -> canvas [ 'height' ] > $ this -> source [ 'height' ] ) { throw new \ Exception ( Helper :: ERROR_UPSCALE ) ; } }
Fetch the dimensions of the source image and calculate the aspect ratio. We also check
to ensure that the image is being resized down, currently we don't support upscaling the
image

@return void
@throws \Exception
Fetch the dimensions of the source image and calculate the aspect ratio . We also check to ensure that the image is being resized down currently we don t support upscaling the image