33 protected function setUp(): void
36 $this->images =
new LegacyImages();
43 [100, 100,
'jpg',
'image/jpeg'],
44 [256, 25,
'jpg',
'image/jpeg'],
45 [1024, 5,
'jpg',
'image/jpeg'],
46 [128, 10,
'jpg',
'image/jpeg'],
47 [895, 22,
'png',
'image/png'],
48 [86, 4,
'png',
'image/png'],
49 [147, 8,
'png',
'image/png'],
50 [1000, 10,
'png',
'image/png'],
54 #[DataProvider('someDefinitions')] 57 int $expected_quality,
59 string $expected_mime_type
61 $img = __DIR__ .
'/img/robot.jpg';
62 $this->assertFileExists($img);
64 $temp_file = tempnam(sys_get_temp_dir(),
'img');
66 $thumbnail = $this->images->thumbnail(
74 $this->assertEquals($temp_file, $thumbnail);
76 $test_image = new \Imagick($thumbnail);
79 if ($format ===
'png') {
80 $expected_quality = 0;
83 $this->assertEquals($expected_quality, $test_image->getImageCompressionQuality());
84 $this->assertEquals($expected_height, $test_image->getImageHeight());
85 $this->assertEquals((
int) round($expected_height * 0.75), $test_image->getImageWidth());
91 if (!class_exists(
'Imagick')) {
92 $this->markTestSkipped(
'Imagick not installed');
testImageThumbnailActualImage(int $expected_height, int $expected_quality, string $format, string $expected_mime_type)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...