src/TemplateHelper.php
public function getHashMaybeUpload(AbstractLocalImage $image)
    {
        if ($hash = $image->getRokkaHash()) {
            return $hash;
        }
        if (!$hash = $this->callbacks->getHash($image)) {
            if (!$this->isImage($image)) {
                return null;
            }
            $sourceImage = $this->imageUpload($image);
            if (null !== $sourceImage) {
                $hash = $this->callbacks->saveHash($image, $sourceImage);
            }
        }

        return $hash;
    }
public function getHashMaybeUpload(AbstractLocalImage $image)
    {
        if ($hash = $image->getRokkaHash()) {
            return $hash;
        }
        if (!$hash = $this->callbacks->getHash($image)) {
            if (!$this->isImage($image)) {
                return null;
            }
            $sourceImage = $this->imageUpload($image);
            if (null !== $sourceImage) {
                $hash = $this->callbacks->saveHash($image, $sourceImage);
            }
        }

        return $hash;
    }
public function getHashMaybeUpload ( AbstractLocalImage $ image ) { if ( $ hash = $ image -> getRokkaHash ( ) ) { return $ hash ; } if ( ! $ hash = $ this -> callbacks -> getHash ( $ image ) ) { if ( ! $ this -> isImage ( $ image ) ) { return null ; } $ sourceImage = $ this -> imageUpload ( $ image ) ; if ( null !== $ sourceImage ) { $ hash = $ this -> callbacks -> saveHash ( $ image , $ sourceImage ) ; } } return $ hash ; }
Returns the hash of an image.
If we don't have an image stored locally, it uploads it to rokka.

@since 1.3.0

@param AbstractLocalImage $image

@throws \GuzzleHttp\Exception\GuzzleException
@throws \RuntimeException

@return string|null
Returns the hash of an image . If we don t have an image stored locally it uploads it to rokka .