src/Image.php
public function deleteDynamicMetadata($dynamicMetadataName, $hash, $organization = '', $options = [])
    {
        if (empty($hash)) {
            throw new \LogicException('Missing image Hash.');
        }

        if (empty($dynamicMetadataName)) {
            throw new \LogicException('Missing DynamicMetadata name.');
        }

        $path = implode('/', [
            self::SOURCEIMAGE_RESOURCE,
            $this->getOrganizationName($organization),
            $hash,
            self::DYNAMIC_META_RESOURCE,
            $dynamicMetadataName,
        ]);

        $callOptions = [];
        if (isset($options['deletePrevious']) && $options['deletePrevious']) {
            $callOptions['query'] = ['deletePrevious' => 'true'];
        }

        $response = $this->call('DELETE', $path, $callOptions);

        if ($response->getStatusCode() >= 200 && $response->getStatusCode() < 300) {
            return $this->extractHashFromLocationHeader($response->getHeader('Location'));
        }

        // Throw an exception to be handled by the caller.
        throw new \LogicException($response->getBody()->getContents(), $response->getStatusCode());
    }
public function deleteDynamicMetadata($dynamicMetadataName, $hash, $organization = '', $options = [])
    {
        if (empty($hash)) {
            throw new \LogicException('Missing image Hash.');
        }

        if (empty($dynamicMetadataName)) {
            throw new \LogicException('Missing DynamicMetadata name.');
        }

        $path = implode('/', [
            self::SOURCEIMAGE_RESOURCE,
            $this->getOrganizationName($organization),
            $hash,
            self::DYNAMIC_META_RESOURCE,
            $dynamicMetadataName,
        ]);

        $callOptions = [];
        if (isset($options['deletePrevious']) && $options['deletePrevious']) {
            $callOptions['query'] = ['deletePrevious' => 'true'];
        }

        $response = $this->call('DELETE', $path, $callOptions);

        if ($response->getStatusCode() >= 200 && $response->getStatusCode() < 300) {
            return $this->extractHashFromLocationHeader($response->getHeader('Location'));
        }

        // Throw an exception to be handled by the caller.
        throw new \LogicException($response->getBody()->getContents(), $response->getStatusCode());
    }
public function deleteDynamicMetadata ( $ dynamicMetadataName , $ hash , $ organization = '' , $ options = [ ] ) { if ( empty ( $ hash ) ) { throw new \ LogicException ( 'Missing image Hash.' ) ; } if ( empty ( $ dynamicMetadataName ) ) { throw new \ LogicException ( 'Missing DynamicMetadata name.' ) ; } $ path = implode ( '/' , [ self :: SOURCEIMAGE_RESOURCE , $ this -> getOrganizationName ( $ organization ) , $ hash , self :: DYNAMIC_META_RESOURCE , $ dynamicMetadataName , ] ) ; $ callOptions = [ ] ; if ( isset ( $ options [ 'deletePrevious' ] ) && $ options [ 'deletePrevious' ] ) { $ callOptions [ 'query' ] = [ 'deletePrevious' => 'true' ] ; } $ response = $ this -> call ( 'DELETE' , $ path , $ callOptions ) ; if ( $ response -> getStatusCode ( ) >= 200 && $ response -> getStatusCode ( ) < 300 ) { return $ this -> extractHashFromLocationHeader ( $ response -> getHeader ( 'Location' ) ) ; } // Throw an exception to be handled by the caller. throw new \ LogicException ( $ response -> getBody ( ) -> getContents ( ) , $ response -> getStatusCode ( ) ) ; }
Delete the given DynamicMetadata from a SourceImage.
Returns the new Hash for the SourceImage, it could be the same as the input one if the operation
did not change it.

The only option currently can be
['deletePrevious' => true]
which deletes the previous image from rokka (but not the binary, since that's still used)
If not set, the original image is kept in rokka.

@param string $dynamicMetadataName The DynamicMetadata name
@param string $hash                The Image hash
@param string $organization        Optional organization name
@param array  $options             Optional options

@throws GuzzleException
@throws \RuntimeException

@return string|false
Delete the given DynamicMetadata from a SourceImage . Returns the new Hash for the SourceImage it could be the same as the input one if the operation did not change it .