Set png adapter

@param \PHPImageOptim\Tools\Png\OptiPng $optiPng
@return \Extlib\ImageOptimizer
501998
public function setOptiPng(\PHPImageOptim\Tools\Png\OptiPng $optiPng)
    {
        $this->optiPng = $optiPng;
        return $this;
    }
153686
public function setDefaultImage($image)
    {
        $imgLower = strtolower($image);
        
        $validDefaults = array('404', 'mm', 'identicon', 'monsterid', 'wavatar', 'retro');
        if (!in_array($imgLower, $validDefaults)) {
            // Verifie la bonne url
            if (!filter_var($image, FILTER_VALIDATE_URL)) {
                throw new InvalidArgumentException('The default image specified is not a recognized gravatar "default" and is not a valid URL');
            } else {
                $this->defaultImage = rawurlencode($image);
            }
        } else {
            $this->defaultImage = $imgLower;
        }
        
        return $this;
    }
529802
public function setOption($optArray) {
		if (!is_array($optArray) || empty($optArray)) {
			return false;
		}
		foreach ($optArray as $opt => $val) {
			if (isset($this->$opt) === false) {
				continue;
			}
			$this->$opt = $val;
		}
		return true;
	}
1256640
public function setTransparency()
    {
        imagealphablending($this->resource, false);
        imagesavealpha($this->resource, true);

        return $this;
    }
1236777
public function setOption($level, $optname, $optval)
    {
        $ret = @socket_set_option($this->resource, $level, $optname, $optval);
        if ($ret === false) {
            throw Exception::createFromSocketResource($this->resource);
        }
        return $this;
    }
115600
public function setImageSet($imageSet)
    {
        if (! in_array($imageSet, $this->availableImageSets)) {
            throw new \InvalidArgumentException('Invalid Gravatar image set.');
        }

        $this->imageSet = $imageSet;
    }
308925
public function setImageManager(ImageManager $imageManager = null, array $config = [])
    {
        if (!$imageManager) {
            $imageManager = new ImageManager($config);
        }
        $this->imageManager = $imageManager;

        return $this;
    }
441750
public function setProvider(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Provider $provider = null)
    {
        $this->provider = $provider;

        return $this;
    }
275818
public function setImagesField($fieldsOptions)
    {
        if (isset(static::$imageFields)) {
            static::$imageFields = array_merge($this->getDefinedUploadFields(), $fieldsOptions);
        } else {
            $this->imagesFields = $fieldsOptions;
        }

        return $this;
    }
541821
protected function execExternalOptimizer($if, &$binaryContent)
	{
	    $cmd = [
	        $this->getOption('jpegtran', 'jpegtran'),
	        $this->getOption('jpegtran_options', '-copy none -optimize'),
	        $if,
	    ];
	    $ret = null;
	    ob_start();
	    passthru(implode(' ', $cmd), $ret);
	    $binaryContent = ob_get_clean();
    	if ($ret !== 0) {
			throw new ImageOptimizerException(sprintf('Exec error jpegtran (%d)', $ret), ImageOptimizerException::EXEC_ERROR);
		}
	    return 'image/jpeg';
	}
1222741
public function setImage($image)
    {
        if (getimagesize($image)) {
            if (strpos($image, 'http') === false) {
                loader()->loadHelper('url');
                $image = images_url($image);
            }

            $this->setObject('image', $image);
        }

        return $this;
    }
658880
public function setFlag($key)
    {
        $util_flags = $this->utilFlags();

        if (in_array($key, $util_flags)) {
            $this->flags[ $key ] = $key;

            return $this;
        }
        throw new PopplerPhpException("Unknown '".get_class($this)."' Flag: ".$key);
    }
236812
public function setImage($image)
    {
        if (!is_null($image) && !$image instanceof ComActivitiesActivityMedialinkInterface) {
            throw new InvalidArgumentException('Invalid image type.');
        }

        $this->image = $image;
        return $this;
    }
1359929
public function png(&$img)
    {
        if (is_null($this->center) || is_null($this->radius)) {
            throw new \RuntimeException('Before exporting to PNG, you must give center and radius!');
        }

        imagefilledellipse(
            $img,
            $this->center->x,
            $this->center->y,
            $this->radius->w,
            $this->radius->h,
            $this->color->gd($img)
        );
    }
181638
public function setImageOG($imageObj)
    {
        if($imageObj) {
            Meta::set("og:image", asset($imageObj->url), "property");
            Meta::set("og:image:type", $imageObj->type."/".str_replace("jpg", "jpeg", $imageObj->extension), "property");
            if($imageObj->description) {
                Meta::set("og:image:alt", $imageObj->description, "property");
            }

            if($imageObj->dimensions) {
                $image = explode("x", $imageObj->dimensions);
                Meta::set("og:image:width", $image[0], "property");
                Meta::set("og:image:height", $image[1], "property");
            }
        }
        return $this;
    }
1188996
public function setImage($image)
    {
        if ($image instanceof FeedImage) {
            $this->image = $image;
        } elseif (is_array($image)) {
            if (!empty($image)) {
                $this->image = FeedImage::createFromArray($image);
            }
        } elseif (is_null($image)) {
            $this->image = null;
        } else {
            throw new \InvalidArgumentException('Invalid image');
        }

        return $this;
    }
278743
public function setTermsOptin($optin, $game, $user)
    {
        $entry = $this->checkExistingEntry($game, $user, true);

        if ($entry) {
            $entry->setTermsOptin($optin);
            $entry = $this->getEntryMapper()->update($entry);
        } else {
            if (!$this->hasReachedPlayLimit($game, $user)
                && $this->canPayToPlay($game, $user)
            ) {
                $ip = $this->getIp();
                $geoloc = $this->getGeoloc($ip);
                $entry = new Entry();
                $entry->setGame($game);
                $entry->setUser($user);
                $entry->setPoints(0);
                $entry->setIp($ip);
                $entry->setGeoloc($geoloc);
                $entry->setAnonymousId($this->getAnonymousId());
                if ($this->getAnonymousIdentifier()) {
                    $entry->setAnonymousIdentifier($this->getAnonymousIdentifier());
                }
                $entry->setTermsOptin($optin);
                $entry = $this->getEntryMapper()->insert($entry);
            }
        }

        if ($entry) {
            $this->getEventManager()->trigger(
                __FUNCTION__ . '.post',
                $this,
                [
                    'user' => $user,
                    'game' => $game,
                    'entry' => $entry,
                ]
            );

            return true;
        }

        return false;
    }