private function createImageResource()
    {
        // We are currently using vips_image_new_from_file(), but we could consider
        // calling vips_jpegload / vips_pngload instead
        $result = /** @scrutinizer ignore-call */ vips_image_new_from_file($this->source, []);
        if ($result === -1) {
            /*throw new ConversionFailedException(
                'Failed creating new vips image from file: ' . $this->source
            );*/
            $message = /** @scrutinizer ignore-call */ vips_error_buffer();
            throw new ConversionFailedException($message);
        }

        if (!is_array($result)) {
            throw new ConversionFailedException(
                'vips_image_new_from_file did not return an array, which we expected'
            );
        }

        if (count($result) != 1) {
            throw new ConversionFailedException(
                'vips_image_new_from_file did not return an array of length 1 as we expected ' .
                '- length was: ' . count($result)
            );
        }

        $im = array_shift($result);
        return $im;
    }
private function createImageResource()
    {
        // We are currently using vips_image_new_from_file(), but we could consider
        // calling vips_jpegload / vips_pngload instead
        $result = /** @scrutinizer ignore-call */ vips_image_new_from_file($this->source, []);
        if ($result === -1) {
            /*throw new ConversionFailedException(
                'Failed creating new vips image from file: ' . $this->source
            );*/
            $message = /** @scrutinizer ignore-call */ vips_error_buffer();
            throw new ConversionFailedException($message);
        }

        if (!is_array($result)) {
            throw new ConversionFailedException(
                'vips_image_new_from_file did not return an array, which we expected'
            );
        }

        if (count($result) != 1) {
            throw new ConversionFailedException(
                'vips_image_new_from_file did not return an array of length 1 as we expected ' .
                '- length was: ' . count($result)
            );
        }

        $im = array_shift($result);
        return $im;
    }
private function createImageResource ( ) { // We are currently using vips_image_new_from_file(), but we could consider // calling vips_jpegload / vips_pngload instead $ result = /** @scrutinizer ignore-call */ vips_image_new_from_file ( $ this -> source , [ ] ) ; if ( $ result === - 1 ) { /*throw new ConversionFailedException(
                'Failed creating new vips image from file: ' . $this->source
            );*/ $ message = /** @scrutinizer ignore-call */ vips_error_buffer ( ) ; throw new ConversionFailedException ( $ message ) ; } if ( ! is_array ( $ result ) ) { throw new ConversionFailedException ( 'vips_image_new_from_file did not return an array, which we expected' ) ; } if ( count ( $ result ) != 1 ) { throw new ConversionFailedException ( 'vips_image_new_from_file did not return an array of length 1 as we expected ' . '- length was: ' . count ( $ result ) ) ; } $ im = array_shift ( $ result ) ; return $ im ; }
Create vips image resource from source file

@throws  ConversionFailedException  if image resource cannot be created
@return  resource  vips image resource
Create vips image resource from source file