@param $license

@throws ImageItemException

@return $this
977513
public function setLicense($license)
    {
        self::writeFullTag(
            $license,
            'license',
            true,
            'image:license',
            $this->validator,
            'validateLicense',
            $this->exception,
            'Provided license is not a valid value.'
        );

        return $this;
    }
791284
private function createFromPng(string $path): self
    {
        $imageData = imagecreatefrompng($path);
        if (false === $imageData) {
            throw new ImageException(sprintf('Unable to create PNG image from %s!', $path));
        }
        $this->workingData = $imageData;
        $this->setTransparency(false, true);
        $this->encrypted = false;
        return $this;
    }
134021
public function setCaption($caption)
    {
        self::writeFullTag(
            $caption,
            'caption',
            true,
            'image:caption',
            $this->validator,
            'validateCaption',
            $this->exception,
            'Provided caption is not a valid value.'
        );

        return $this;
    }
355769
public function createCopy(): AbstractResize
    {
        $this->createCanvas();

        $this->intermediate['copy'] = imagecreatefrompng($this->source['path'] . $this->source['file']);
        if ($this->intermediate['copy'] === false) {
            throw new \Exception('Call to imagecreatefrompng failed');
        }

        $this->resampleCopy();

        return $this;
    }
154206
public function removeImage($location = self::IMAGE_HEADER_LEFT) {
    	if (isset($this->_headerFooterImages[$location])) {
    		unset($this->_headerFooterImages[$location]);
    	}
    	return $this;
    }
1244964
public function remove(object $entity): self
    {
        $identity = $this->extractIdentity($entity);

        try {
            $state = $this->container->stateFor($identity);

            switch ($state) {
                case State::new():
                    $this->container->push(
                        $identity,
                        $entity,
                        State::removed()
                    );
                    break;

                case State::managed():
                    $this->container->push(
                        $identity,
                        $entity,
                        State::toBeRemoved()
                    );
                    break;
            }
        } catch (IdentityNotManaged $e) {
            //pass
        }

        return $this;
    }
501696
protected function storeProductImage(
        ImagesContainerWithPrincipalImageInterface $imageContainer,
        $imageName
    ) {
        $imagePath = realpath(__DIR__ . '/../images/' . $imageName);
        $image = $this->storeImage($imagePath);

        $imageContainer->addImage($image);
        $imageContainer->setPrincipalImage($image);

        return $this;
    }
274078
public function withImage(string $name, string $label)
    {
        $this->contentGroup->images[$name] = ['name' => $name, 'label' => $label, 'order' => $this->order++];

        return $this;
    }
1259911
public function addImage($loc, $geoLocation = null, $caption = null, $title = null, $license = null)
    {
        if (empty($loc)) {
            return $this;
        }

        $image = [
            'loc' => $loc,
            'geoLocation' => $geoLocation,
            'caption' => $caption,
            'title' => $title,
            'license' => $license,
        ];
        $this->images[] = $image;

        return $this;
    }
541327
public function setImageUrl($imageUrl)
    {
        $this->style    = null;
        $this->subStyle = null;
        $this->imageUrl = (string)$imageUrl;
        return $this;
    }
765502
public function addImage( $key, $location, $caption = '', $geolocation = '', $title = '', $license = '' )
    {
        /**
         * @var \Lti\Sitemap\SitemapUrl $node
         */
        $node = $this->get( $key );
        if ( ! is_null( $node )) {
            $node->addImage( new SitemapImage( $location, $caption, $geolocation, $title, $license ) );
            $this->hasImages = true;
        }
    }
1138944
public void setLicense(String photoId, int licenseId) throws FlickrException {
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("method", METHOD_SET_LICENSE);
        parameters.put("photo_id", photoId);
        parameters.put("license_id", Integer.toString(licenseId));

        // Note: This method requires an HTTP POST request.
        Response response = transportAPI.post(transportAPI.getPath(), parameters, apiKey, sharedSecret);
        if (response.isError()) {
            throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
        }
        // This method has no specific response - It returns an empty sucess response if it completes without error.

    }
648450
public function addImage($imageUrl)
    {
        $this->config['imageUrl'] = $imageUrl;
        $this->config['showCloseButton'] = true;
        unset($this->config['type']);
        $this->flash();

        return $this;
    }
1060412
public function removeItemByIndex($index): ContainerInterface
    {
        if ($this->hasItem($index)) {
            $this->items[$index] = null; //prevente unset item.
            unset($this->items[$index]); //unset only index, not the item.
        }

        return $this;
    }
199710
public function prune($license = null)
    {
        if ($license) {
            $this->addUsingAlias(LicensePeer::ID, $license->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }
1007174
public function setImage($imageUrl)
    {
        $this->openGraph()->setImage($imageUrl);
        $this->twitter()->addImage($imageUrl);

        return $this;
    }
513268
public function format($format)
    {
        if (!$this->image) {
            $this->image();
        }

        $this->format = $format;

        return $this;
    }