Skip to content

Commit 9df6cef

Browse files
committed
Added Imagick::getImageMimeType example.
1 parent 3c5a395 commit 9df6cef

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
namespace ImagickDemo\Imagick;
4+
5+
use ImagickDemo\Example;
6+
use ImagickDemo\Imagick\Controls\ImageControl;
7+
use VarMap\VarMap;
8+
9+
class getImageMimeType extends Example
10+
{
11+
private ImageControl $imageControl;
12+
13+
public function __construct(VarMap $varMap)
14+
{
15+
$this->imageControl = ImageControl::createFromVarMap($varMap);
16+
}
17+
18+
public function renderTitle(): string
19+
{
20+
return "Imagick::getImageMimeType";
21+
}
22+
23+
public function render(?string $activeCategory, ?string $activeExample)
24+
{
25+
//Example Imagick::getImageMimeType
26+
$imagick = new \Imagick($this->imageControl->getImagePath());
27+
28+
$output = 'Imagick::getImageMimeType result is: ';
29+
$output .= $imagick->getImageMimeType();
30+
31+
return $output;
32+
//Example end
33+
}
34+
35+
public static function getParamType(): string
36+
{
37+
return ImageControl::class;
38+
}
39+
}

src/example_list.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ function getImagickExamples()
304304
//'getImageMagickLicense',
305305
//'getImageMatte',
306306
//'getImageMatteColor',
307+
'getImageMimeType' => 'getImageMimeType',
307308
//'getImageOrientation',
308309
//'getImagePage',
309310
//'getImagePixelColor',

0 commit comments

Comments
 (0)