File tree 3 files changed +28
-3
lines changed
3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 14
14
- uses : shivammathur/setup-php@v2
15
15
with :
16
16
php-version : ' 7.4'
17
- extensions : gd
17
+ extensions : gd, imagick
18
18
- name : php-cs-fixer
19
19
run : |
20
20
wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.16.4/php-cs-fixer.phar -q
36
36
- uses : shivammathur/setup-php@v2
37
37
with :
38
38
php-version : ${{ matrix.php-version }}
39
- extensions : gd
39
+ extensions : gd, imagick
40
40
coverage : pcov
41
41
42
42
- name : Composer
66
66
- uses : shivammathur/setup-php@v2
67
67
with :
68
68
php-version : ' 7.4'
69
- extensions : gd
69
+ extensions : gd, imagick
70
70
tools : vimeo/psalm:4.15
71
71
- name : psalm
72
72
run : |
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ public function getFormat(Image $image)
52
52
'pjpg ' => 'image/jpeg ' ,
53
53
'png ' => 'image/png ' ,
54
54
'webp ' => 'image/webp ' ,
55
+ 'tiff ' => 'image/tiff ' ,
55
56
];
56
57
57
58
if (array_key_exists ($ this ->fm , $ allowed )) {
Original file line number Diff line number Diff line change @@ -132,4 +132,28 @@ public function testGetQuality()
132
132
$ this ->assertSame (90 , $ this ->manipulator ->setParams (['q ' => '-1 ' ])->getQuality ());
133
133
$ this ->assertSame (90 , $ this ->manipulator ->setParams (['q ' => '101 ' ])->getQuality ());
134
134
}
135
+
136
+ /**
137
+ * Test functions that require the imagick extension.
138
+ *
139
+ * @return void
140
+ */
141
+ public function testWithImagick ()
142
+ {
143
+ if (!extension_loaded ('imagick ' )) {
144
+ $ this ->markTestSkipped (
145
+ 'The imagick extension is not available. '
146
+ );
147
+ }
148
+ $ manager = new ImageManager (['driver ' => 'imagick ' ]);
149
+ //These need to be recreated with the imagick driver selected in the manager
150
+ $ this ->jpg = $ manager ->canvas (100 , 100 )->encode ('jpg ' );
151
+ $ this ->png = $ manager ->canvas (100 , 100 )->encode ('png ' );
152
+ $ this ->gif = $ manager ->canvas (100 , 100 )->encode ('gif ' );
153
+ $ this ->tif = $ manager ->canvas (100 , 100 )->encode ('tiff ' );
154
+
155
+ $ this ->assertSame ('image/tiff ' , $ this ->manipulator ->setParams (['fm ' => 'tiff ' ])->run ($ this ->jpg )->mime );
156
+ $ this ->assertSame ('image/tiff ' , $ this ->manipulator ->setParams (['fm ' => 'tiff ' ])->run ($ this ->png )->mime );
157
+ $ this ->assertSame ('image/tiff ' , $ this ->manipulator ->setParams (['fm ' => 'tiff ' ])->run ($ this ->gif )->mime );
158
+ }
135
159
}
You can’t perform that action at this time.
0 commit comments