| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/nimes/libraries/CBLib/Imagine/Image/ |
Upload File : |
<?php
namespace Imagine\Image;
/**
* Holds a list of image formats.
*
* @since 1.3.0
*/
class FormatList
{
/**
* @var \Imagine\Image\Format[]
*/
private $formats;
public function __construct(array $formats)
{
$this->formats = $formats;
}
/**
* @return \Imagine\Image\Format[]
*/
public function getAll()
{
return $this->formats;
}
/**
* @return string[]
*/
public function getAllIDs()
{
$result = array();
foreach ($this->getAll() as $format) {
$result[] = $format->getID();
}
return $result;
}
/**
* Get a format given its ID.
*
* @param \Imagine\Image\Format|string $format the format (a Format instance of a format ID)
*
* @return \Imagine\Image\Format|null
*/
public function find($format)
{
if (is_string($format)) {
$format = strtolower(trim($format));
if ($format === '') {
return null;
}
foreach ($this->getAll() as $f) {
if ($f->getID() === $format || in_array($format, $f->getAlternativeIDs(), true)) {
return $f;
}
}
return null;
}
return in_array($format, $this->getAll(), true) ? $format : null;
}
}