ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Filesystem\Util\ImageConversionTest Class Reference
+ Inheritance diagram for ILIAS\Filesystem\Util\ImageConversionTest:
+ Collaboration diagram for ILIAS\Filesystem\Util\ImageConversionTest:

Public Member Functions

 testImageThumbnailActualImage ()
 
 testImageSquareActualImage ()
 
 testResizeToFitWidth (int $width, int $height, int $final_width, int $final_height)
 
 testResizeToFitHeight (int $width, int $height, int $final_height, int $final_width)
 
 testResizeByFixedSize (int $width, int $height, int $final_width, int $final_height, bool $crop)
 
 testImageOutputOptions (ImageOutputOptions $options, string $expected_mime_type, int $expected_quality)
 
 testImageOutputOptionSanity ()
 
 testWrongFormats (string $format)
 
 testWrongQualities (int $quality)
 
 testFormatConvert ()
 
 testFailed ()
 
 testBackgroundColor (?string $color)
 
 testWriteImage ()
 
 testHighDensityPixel ()
 

Static Public Member Functions

static getImageSizesByWidth ()
 
static getImageSizesByHeight ()
 
static getImageSizesByFixed ()
 
static getImageOptions ()
 
static getWrongFormats ()
 
static getWrongQualites ()
 
static getColors ()
 

Protected Member Functions

 setUp ()
 
 checkImagick ()
 
 getImageSizeFromStream (FileStream $stream)
 
 getImageTypeFromStream (FileStream $stream)
 
 getImageQualityFromStream (FileStream $stream)
 
 createTestImageStream (int $width, int $height)
 

Protected Attributes

const BY_WIDTH_FINAL = 256
 
const BY_HEIGHT_FINAL = 756
 
const W = 'width'
 
const H = 'height'
 
const IMAGE_JPEG = 'image/jpeg'
 
const IMAGE_PNG = 'image/png'
 
const IMAGE_WEBP = 'image/webp'
 
Images $images
 

Private Member Functions

 colorDiff (string $hex_color_one, string $hex_color_two)
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 33 of file ImageConversionTest.php.

Member Function Documentation

◆ checkImagick()

ILIAS\Filesystem\Util\ImageConversionTest::checkImagick ( )
protected

Definition at line 482 of file ImageConversionTest.php.

482 : void
483 {
484 if (!class_exists('Imagick')) {
485 $this->markTestSkipped('Imagick not installed');
486 }
487 }

Referenced by ILIAS\Filesystem\Util\ImageConversionTest\setUp().

+ Here is the caller graph for this function:

◆ colorDiff()

ILIAS\Filesystem\Util\ImageConversionTest::colorDiff ( string  $hex_color_one,
string  $hex_color_two 
)
private

Definition at line 385 of file ImageConversionTest.php.

385 : int
386 {
387 preg_match('/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i', $hex_color_one, $rgb_one);
388 preg_match('/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i', $hex_color_two, $rgb_two);
389
390 return abs(hexdec($rgb_one[1]) - hexdec($rgb_two[1]))
391 + abs(hexdec($rgb_one[2]) - hexdec($rgb_two[2]))
392 + abs(hexdec($rgb_one[3]) - hexdec($rgb_two[3]));
393 }

◆ createTestImageStream()

ILIAS\Filesystem\Util\ImageConversionTest::createTestImageStream ( int  $width,
int  $height 
)
protected

Definition at line 512 of file ImageConversionTest.php.

512 : FileStream
513 {
514 $img = new \Imagick();
515 $img->newImage($width, $height, new \ImagickPixel('black'));
516 $img->setImageFormat('jpg');
517
518 $stream = Streams::ofString($img->getImageBlob());
519 $stream->rewind();
520 return $stream;
521 }
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:41

◆ getColors()

static ILIAS\Filesystem\Util\ImageConversionTest::getColors ( )
static

Definition at line 369 of file ImageConversionTest.php.

369 : \Iterator
370 {
371 yield [null];
372 yield ['#000000'];
373 yield ['#ff0000'];
374 yield ['#00ff00'];
375 yield ['#0000ff'];
376 yield ['#ffffff'];
377 yield ['#A3BF5A'];
378 yield ['#E9745A'];
379 yield ['#5A5AE9'];
380 yield ['#5AE9E9'];
381 yield ['#E95AE9'];
382 yield ['#E9E95A'];
383 }

◆ getImageOptions()

static ILIAS\Filesystem\Util\ImageConversionTest::getImageOptions ( )
static

Definition at line 233 of file ImageConversionTest.php.

233 : \Iterator
234 {
235 $options = new ImageOutputOptions();
236 yield [$options, self::IMAGE_JPEG, 75];
237 yield [$options->withPngOutput()->withQuality(22), self::IMAGE_PNG, 0];
238 yield [$options->withJpgOutput()->withQuality(100), self::IMAGE_JPEG, 100];
239 yield [$options->withFormat('png')->withQuality(50), self::IMAGE_PNG, 0];
240 yield [$options->withFormat('jpg')->withQuality(87), self::IMAGE_JPEG, 87];
241 yield [$options->withQuality(5)->withJpgOutput(), self::IMAGE_JPEG, 5];
242 yield [$options->withQuality(10)->withJpgOutput(), self::IMAGE_JPEG, 10];
243 yield [$options->withQuality(35)->withJpgOutput(), self::IMAGE_JPEG, 35];
244 yield [$options->withQuality(0)->withWebPOutput(), self::IMAGE_WEBP, 0];
245 yield [$options->withQuality(100)->withWebPOutput(), self::IMAGE_WEBP, 100];
246 }

◆ getImageQualityFromStream()

ILIAS\Filesystem\Util\ImageConversionTest::getImageQualityFromStream ( FileStream  $stream)
protected

Definition at line 503 of file ImageConversionTest.php.

503 : int
504 {
505 $stream->rewind();
506 $img = new \Imagick();
507 $img->readImageBlob((string) $stream);
508
509 return $img->getImageCompressionQuality();
510 }

◆ getImageSizeFromStream()

ILIAS\Filesystem\Util\ImageConversionTest::getImageSizeFromStream ( FileStream  $stream)
protected

Definition at line 489 of file ImageConversionTest.php.

489 : array
490 {
491 $getimagesizefromstring = getimagesizefromstring((string) $stream);
492 return [
493 self::W => (int) round($getimagesizefromstring[0]),
494 self::H => (int) round($getimagesizefromstring[1])
495 ];
496 }

References ILIAS\Repository\int().

Referenced by ILIAS\Filesystem\Util\ImageConversionTest\testImageSquareActualImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImageSizesByFixed()

static ILIAS\Filesystem\Util\ImageConversionTest::getImageSizesByFixed ( )
static

Definition at line 202 of file ImageConversionTest.php.

202 : \Iterator
203 {
204 yield [1024, 768, 300, 100, true];
205 yield [1024, 768, 300, 100, false];
206 yield [1024, 768, 100, 300, true];
207 yield [1024, 768, 100, 300, false];
208 yield [400, 300, 500, 400, true];
209 yield [400, 300, 500, 400, false];
210 }

◆ getImageSizesByHeight()

static ILIAS\Filesystem\Util\ImageConversionTest::getImageSizesByHeight ( )
static

Definition at line 154 of file ImageConversionTest.php.

154 : \Iterator
155 {
156 yield [400, 300, self::BY_HEIGHT_FINAL, 1008];
157 yield [300, 400, self::BY_HEIGHT_FINAL, 567];
158 yield [200, 200, self::BY_HEIGHT_FINAL, 756];
159 yield [248, 845, self::BY_HEIGHT_FINAL, 221];
160 }

◆ getImageSizesByWidth()

static ILIAS\Filesystem\Util\ImageConversionTest::getImageSizesByWidth ( )
static

Definition at line 107 of file ImageConversionTest.php.

107 : \Iterator
108 {
109 yield [400, 300, self::BY_WIDTH_FINAL, 192];
110 yield [300, 400, self::BY_WIDTH_FINAL, 341];
111 yield [543, 431, self::BY_WIDTH_FINAL, 203];
112 yield [200, 200, self::BY_WIDTH_FINAL, 256];
113 }

References ILIAS\Filesystem\Util\ImageConversionTest\BY_WIDTH_FINAL.

◆ getImageTypeFromStream()

ILIAS\Filesystem\Util\ImageConversionTest::getImageTypeFromStream ( FileStream  $stream)
protected

Definition at line 498 of file ImageConversionTest.php.

498 : string
499 {
500 return finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $stream->read(255));
501 }

◆ getWrongFormats()

static ILIAS\Filesystem\Util\ImageConversionTest::getWrongFormats ( )
static

Definition at line 294 of file ImageConversionTest.php.

294 : \Iterator
295 {
296 yield ['gif'];
297 yield ['bmp'];
298 yield ['jpg2000'];
299 }

◆ getWrongQualites()

static ILIAS\Filesystem\Util\ImageConversionTest::getWrongQualites ( )
static

Definition at line 309 of file ImageConversionTest.php.

309 : \Iterator
310 {
311 yield [-1];
312 yield [101];
313 yield [102];
314 }

◆ setUp()

ILIAS\Filesystem\Util\ImageConversionTest::setUp ( )
protected

Definition at line 46 of file ImageConversionTest.php.

46 : void
47 {
48 $this->checkImagick();
49 $this->images = new Images(
50 true,
51 );
52 }

References ILIAS\Filesystem\Util\ImageConversionTest\checkImagick().

+ Here is the call graph for this function:

◆ testBackgroundColor()

ILIAS\Filesystem\Util\ImageConversionTest::testBackgroundColor ( ?string  $color)

Definition at line 396 of file ImageConversionTest.php.

396 : void
397 {
398 $transparent_png = __DIR__ . '/img/transparent.png';
399 $this->assertFileExists($transparent_png);
400 $png = Streams::ofResource(fopen($transparent_png, 'rb'));
401
402 $converter_options = (new ImageConversionOptions())
403 ->withThrowOnError(true)
404 ->withFixedDimensions(100, 100);
405
406 if ($color !== null) {
407 $converter_options = $converter_options->withBackgroundColor($color);
408 } else {
409 $color = '#ffffff';
410 }
411
412 $output_options = (new ImageOutputOptions())
413 ->withQuality(100)
414 ->withJpgOutput();
415
416 $converter = new ImageConverter($converter_options, $output_options, $png);
417 $this->assertTrue($converter->isOK());
418 $converted_stream = $converter->getStream();
419 $gd_image = imagecreatefromstring((string) $converted_stream);
420 $colors = imagecolorsforindex($gd_image, imagecolorat($gd_image, 1, 1));
421
422 $color_in_converted_picture = sprintf("#%02x%02x%02x", $colors['red'], $colors['green'], $colors['blue']);
423 $color_diff = $this->colorDiff($color, $color_in_converted_picture);
424
425 $this->assertLessThan(3, $color_diff);
426 }
static ofResource($resource)
Wraps an already created resource with the stream abstraction.
Definition: Streams.php:64
colorDiff(string $hex_color_one, string $hex_color_two)

◆ testFailed()

ILIAS\Filesystem\Util\ImageConversionTest::testFailed ( )

Definition at line 352 of file ImageConversionTest.php.

352 : void
353 {
354 $false_stream = Streams::ofString('false');
355 $images = new Images(
356 false,
357 false
358 );
359
360 $resized = $images->resizeToFixedSize(
361 $false_stream,
362 5,
363 5
364 );
365 $this->assertFalse($resized->isOK());
366 $this->assertInstanceOf(\Throwable::class, $resized->getThrowableIfAny());
367 }
resizeToFixedSize(FileStream $stream, int $width, int $height, bool $crop_or_otherwise_squeeze=true, ?ImageOutputOptions $image_output_options=null)
@description Creates an image from the given stream, resized to width and height given.
Definition: Images.php:133

References ILIAS\Filesystem\Util\Convert\Images\resizeToFixedSize().

+ Here is the call graph for this function:

◆ testFormatConvert()

ILIAS\Filesystem\Util\ImageConversionTest::testFormatConvert ( )

Definition at line 324 of file ImageConversionTest.php.

324 : void
325 {
326 $jpg = $this->createTestImageStream(10, 10);
327 $png = $this->images->convertToFormat(
328 $jpg,
329 'png'
330 );
331
332 $this->assertSame(self::IMAGE_PNG, $this->getImageTypeFromStream($png->getStream()));
333 $size = $this->getImageSizeFromStream($png->getStream());
334 $this->assertEquals(10, $size[self::W]);
335 $this->assertEquals(10, $size[self::H]);
336
337 // With Dimensions
338 $jpg = $this->createTestImageStream(10, 10);
339 $png = $this->images->convertToFormat(
340 $jpg,
341 'png',
342 20,
343 20
344 );
345
346 $this->assertSame(self::IMAGE_PNG, $this->getImageTypeFromStream($png->getStream()));
347 $size = $this->getImageSizeFromStream($png->getStream());
348 $this->assertEquals(20, $size[self::W]);
349 $this->assertEquals(20, $size[self::H]);
350 }

◆ testHighDensityPixel()

ILIAS\Filesystem\Util\ImageConversionTest::testHighDensityPixel ( )

Definition at line 453 of file ImageConversionTest.php.

453 : void
454 {
455 $file = 'https://upload.wikimedia.org/wikipedia/commons/5/5e/Jan_Vermeer_-_The_Art_of_Painting_-_Google_Art_Project.jpg';
456 $curl = curl_init();
457 curl_setopt($curl, CURLOPT_URL, $file);
458 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
459 curl_setopt($curl, CURLOPT_USERAGENT, 'PHPUnit/1.0');
460 $string = curl_exec($curl);
461 curl_close($curl);
462
463 $img = Streams::ofString($string);
464 $this->assertInstanceOf(FileStream::class, $img);
465
466 $converter_options = (new ImageConversionOptions())
467 ->withWidth(80)
468 ->withHeight(80)
469 ->withKeepAspectRatio(true)
470 ->withCrop(true)
471 ->withThrowOnError(true);
472
473 $output_options = (new ImageOutputOptions())
474 ->withQuality(60)
475 ->withFormat(ImageOutputOptions::FORMAT_PNG);
476
477 $converter = new ImageConverter($converter_options, $output_options, $img);
478 $this->assertTrue($converter->isOK());
479 }

◆ testImageOutputOptions()

ILIAS\Filesystem\Util\ImageConversionTest::testImageOutputOptions ( ImageOutputOptions  $options,
string  $expected_mime_type,
int  $expected_quality 
)

Definition at line 250 of file ImageConversionTest.php.

254 : void {
255 $resized = $this->images->resizeToFixedSize(
256 $this->createTestImageStream(10, 10),
257 5,
258 5,
259 true,
260 $options
261 );
262
263 $this->assertSame($expected_mime_type, $this->getImageTypeFromStream($resized->getStream()));
264 $this->assertSame($expected_quality, $this->getImageQualityFromStream($resized->getStream()));
265 }

◆ testImageOutputOptionSanity()

ILIAS\Filesystem\Util\ImageConversionTest::testImageOutputOptionSanity ( )

Definition at line 267 of file ImageConversionTest.php.

267 : void
268 {
269 $options = new ImageOutputOptions();
270
271 // Defaults
272 $this->assertSame('jpg', $options->getFormat());
273 $this->assertSame(75, $options->getQuality());
274
275 $png = $options->withPngOutput();
276 $this->assertSame('png', $png->getFormat());
277 $this->assertSame('jpg', $options->getFormat()); // original options should not change
278 $png_explicit = $options->withFormat('png');
279 $this->assertSame('png', $png_explicit->getFormat());
280
281 $jpg = $options->withJpgOutput();
282 $this->assertSame('jpg', $jpg->getFormat());
283 $jpg_explicit = $options->withFormat('jpg');
284 $this->assertSame('jpg', $jpg_explicit->getFormat());
285 $jpeg = $options->withFormat('jpeg');
286 $this->assertSame('jpg', $jpeg->getFormat());
287
288 // Quality
289 $low = $options->withQuality(5);
290 $this->assertSame(5, $low->getQuality());
291 $this->assertSame(75, $options->getQuality()); // original options should not change
292 }

References ILIAS\Filesystem\Util\Convert\ImageOutputOptions\getFormat(), ILIAS\Filesystem\Util\Convert\ImageOutputOptions\getQuality(), ILIAS\Filesystem\Util\Convert\ImageOutputOptions\withFormat(), ILIAS\Filesystem\Util\Convert\ImageOutputOptions\withJpgOutput(), ILIAS\Filesystem\Util\Convert\ImageOutputOptions\withPngOutput(), and ILIAS\Filesystem\Util\Convert\ImageOutputOptions\withQuality().

+ Here is the call graph for this function:

◆ testImageSquareActualImage()

ILIAS\Filesystem\Util\ImageConversionTest::testImageSquareActualImage ( )

Definition at line 81 of file ImageConversionTest.php.

81 : void
82 {
83 $img = __DIR__ . '/img/robot.jpg';
84 $this->assertFileExists($img);
85 $getimagesize = getimagesize($img);
86 $original_width = $getimagesize[0]; // should be 600
87 $original_height = $getimagesize[1]; // should be 800
88 $this->assertSame(600, $original_width);
89 $this->assertSame(800, $original_height);
90
91 // make tumbnail
92 $original_stream = Streams::ofResource(fopen($img, 'rb'));
93
94 $thumbnail_converter = $this->images->croppedSquare(
95 $original_stream,
96 200
97 );
98 $this->assertTrue($thumbnail_converter->isOK());
99 $this->assertNotInstanceOf(\Throwable::class, $thumbnail_converter->getThrowableIfAny());
100
101 $getimagesizefromstring = $this->getImageSizeFromStream($thumbnail_converter->getStream());
102
103 $this->assertEquals(200, $getimagesizefromstring[self::W]);
104 $this->assertEquals(200, $getimagesizefromstring[self::H]);
105 }

References ILIAS\Filesystem\Util\ImageConversionTest\getImageSizeFromStream(), and ILIAS\Filesystem\Stream\Streams\ofResource().

+ Here is the call graph for this function:

◆ testImageThumbnailActualImage()

ILIAS\Filesystem\Util\ImageConversionTest::testImageThumbnailActualImage ( )

Definition at line 54 of file ImageConversionTest.php.

54 : void
55 {
56 $img = __DIR__ . '/img/robot.jpg';
57 $this->assertFileExists($img);
58 $getimagesize = getimagesize($img);
59 $original_width = $getimagesize[0]; // should be 600
60 $original_height = $getimagesize[1]; // should be 800
61 $this->assertSame(600, $original_width);
62 $this->assertSame(800, $original_height);
63
64 // make tumbnail
65 $original_stream = Streams::ofResource(fopen($img, 'rb'));
66
67 $thumbnail_converter = $this->images->thumbnail(
68 $original_stream,
69 100
70 );
71 $this->assertTrue($thumbnail_converter->isOK());
72 $this->assertNotInstanceOf(\Throwable::class, $thumbnail_converter->getThrowableIfAny());
73 $converted_stream = $thumbnail_converter->getStream();
74
75 $getimagesizefromstring = getimagesizefromstring((string) $converted_stream);
76
77 $this->assertSame(75, $getimagesizefromstring[0]); // width
78 $this->assertSame(100, $getimagesizefromstring[1]); // height
79 }

References ILIAS\Filesystem\Stream\Streams\ofResource().

+ Here is the call graph for this function:

◆ testResizeByFixedSize()

ILIAS\Filesystem\Util\ImageConversionTest::testResizeByFixedSize ( int  $width,
int  $height,
int  $final_width,
int  $final_height,
bool  $crop 
)

Definition at line 213 of file ImageConversionTest.php.

219 : void {
220 $stream = $this->createTestImageStream($width, $height);
221 $dimensions = $this->getImageSizeFromStream($stream);
222 $this->assertEquals($width, $dimensions[self::W]);
223 $this->assertEquals($height, $dimensions[self::H]);
224
225 $by_fixed = $this->images->resizeToFixedSize($stream, $final_width, $final_height, $crop);
226 $this->assertTrue($by_fixed->isOK());
227 $new_dimensions = $this->getImageSizeFromStream($by_fixed->getStream());
228
229 $this->assertEquals($final_width, $new_dimensions[self::W]);
230 $this->assertEquals($final_height, $new_dimensions[self::H]);
231 }

◆ testResizeToFitHeight()

ILIAS\Filesystem\Util\ImageConversionTest::testResizeToFitHeight ( int  $width,
int  $height,
int  $final_height,
int  $final_width 
)

Definition at line 164 of file ImageConversionTest.php.

169 : void {
170 $stream = $this->createTestImageStream($width, $height);
171 $dimensions = $this->getImageSizeFromStream($stream);
172 $this->assertEquals($width, $dimensions[self::W]);
173 $this->assertEquals($height, $dimensions[self::H]);
174
175 // resize to fit
176 $resized = $this->images->resizeByHeight($stream, self::BY_HEIGHT_FINAL);
177 $this->assertTrue($resized->isOK());
178 $new_dimensions = $this->getImageSizeFromStream($resized->getStream());
179
180 $this->assertEquals($final_width, $new_dimensions[self::W]);
181 $this->assertEquals($final_height, $new_dimensions[self::H]);
182
183 // check aspect ratio
184 $this->assertSame(
185 round($width > $height),
186 round($final_width > $final_height)
187 );
188 $this->assertSame(
189 round($width / $height),
190 round($new_dimensions[self::W] / $new_dimensions[self::H])
191 );
192 $this->assertSame(
193 $width > $height,
194 $width > $height
195 );
196 $this->assertSame(
197 $width > $height,
198 $new_dimensions[self::W] > $new_dimensions[self::H]
199 );
200 }

◆ testResizeToFitWidth()

ILIAS\Filesystem\Util\ImageConversionTest::testResizeToFitWidth ( int  $width,
int  $height,
int  $final_width,
int  $final_height 
)

Definition at line 116 of file ImageConversionTest.php.

121 : void {
122 $stream = $this->createTestImageStream($width, $height);
123 $dimensions = $this->getImageSizeFromStream($stream);
124 $this->assertEquals($width, $dimensions[self::W]);
125 $this->assertEquals($height, $dimensions[self::H]);
126
127 // resize to fit width
128 $resized = $this->images->resizeByWidth($stream, self::BY_WIDTH_FINAL);
129 $this->assertTrue($resized->isOK());
130 $new_dimensions = $this->getImageSizeFromStream($resized->getStream());
131
132 $this->assertEquals($final_width, $new_dimensions[self::W]);
133 $this->assertEquals($final_height, $new_dimensions[self::H]);
134
135 // check aspect ratio
136 $this->assertSame(
137 round($width > $height),
138 round($final_width > $final_height)
139 );
140 $this->assertSame(
141 round($width / $height),
142 round($new_dimensions[self::W] / $new_dimensions[self::H])
143 );
144 $this->assertSame(
145 $width > $height,
146 $width > $height
147 );
148 $this->assertSame(
149 $width > $height,
150 $new_dimensions[self::W] > $new_dimensions[self::H]
151 );
152 }

◆ testWriteImage()

ILIAS\Filesystem\Util\ImageConversionTest::testWriteImage ( )

Definition at line 428 of file ImageConversionTest.php.

428 : void
429 {
430 $img = $this->createTestImageStream(10, 10);
431
432 $output_path = __DIR__ . '/img/output.jpg';
433 $converter_options = (new ImageConversionOptions())
434 ->withThrowOnError(true)
435 ->withMakeTemporaryFiles(false)
436 ->withFixedDimensions(100, 100)
437 ->withOutputPath($output_path);
438
439 $output_options = (new ImageOutputOptions())
440 ->withQuality(10)
441 ->withJpgOutput();
442
443 $converter = new ImageConverter($converter_options, $output_options, $img);
444 $this->assertTrue($converter->isOK());
445
446 $this->assertFileExists($output_path);
447 $stream = $converter->getStream();
448 $this->assertEquals($output_path, $stream->getMetadata('uri'));
449
450 unlink($output_path);
451 }

◆ testWrongFormats()

ILIAS\Filesystem\Util\ImageConversionTest::testWrongFormats ( string  $format)

Definition at line 302 of file ImageConversionTest.php.

302 : void
303 {
304 $options = new ImageOutputOptions();
305 $this->expectException(\InvalidArgumentException::class);
306 $wrong = $options->withFormat($format);
307 }

References ILIAS\Filesystem\Util\Convert\ImageOutputOptions\withFormat().

+ Here is the call graph for this function:

◆ testWrongQualities()

ILIAS\Filesystem\Util\ImageConversionTest::testWrongQualities ( int  $quality)

Definition at line 317 of file ImageConversionTest.php.

317 : void
318 {
319 $options = new ImageOutputOptions();
320 $this->expectException(\InvalidArgumentException::class);
321 $wrong = $options->withQuality($quality);
322 }

References ILIAS\Filesystem\Util\Convert\ImageOutputOptions\withQuality().

+ Here is the call graph for this function:

Field Documentation

◆ $images

Images ILIAS\Filesystem\Util\ImageConversionTest::$images
protected

Definition at line 44 of file ImageConversionTest.php.

◆ BY_HEIGHT_FINAL

const ILIAS\Filesystem\Util\ImageConversionTest::BY_HEIGHT_FINAL = 756
protected

Definition at line 38 of file ImageConversionTest.php.

◆ BY_WIDTH_FINAL

const ILIAS\Filesystem\Util\ImageConversionTest::BY_WIDTH_FINAL = 256
protected

◆ H

const ILIAS\Filesystem\Util\ImageConversionTest::H = 'height'
protected

Definition at line 40 of file ImageConversionTest.php.

◆ IMAGE_JPEG

const ILIAS\Filesystem\Util\ImageConversionTest::IMAGE_JPEG = 'image/jpeg'
protected

Definition at line 41 of file ImageConversionTest.php.

◆ IMAGE_PNG

const ILIAS\Filesystem\Util\ImageConversionTest::IMAGE_PNG = 'image/png'
protected

Definition at line 42 of file ImageConversionTest.php.

◆ IMAGE_WEBP

const ILIAS\Filesystem\Util\ImageConversionTest::IMAGE_WEBP = 'image/webp'
protected

Definition at line 43 of file ImageConversionTest.php.

◆ W

const ILIAS\Filesystem\Util\ImageConversionTest::W = 'width'
protected

Definition at line 39 of file ImageConversionTest.php.


The documentation for this class was generated from the following file: