Skip to content

Commit

Permalink
Added Imagick::getImageMimeType example.
Browse files Browse the repository at this point in the history
  • Loading branch information
Danack committed Jan 1, 2022
1 parent 3c5a395 commit 9df6cef
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/ImagickDemo/Imagick/getImageMimeType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace ImagickDemo\Imagick;

use ImagickDemo\Example;
use ImagickDemo\Imagick\Controls\ImageControl;
use VarMap\VarMap;

class getImageMimeType extends Example
{
private ImageControl $imageControl;

public function __construct(VarMap $varMap)
{
$this->imageControl = ImageControl::createFromVarMap($varMap);
}

public function renderTitle(): string
{
return "Imagick::getImageMimeType";
}

public function render(?string $activeCategory, ?string $activeExample)
{
//Example Imagick::getImageMimeType
$imagick = new \Imagick($this->imageControl->getImagePath());

$output = 'Imagick::getImageMimeType result is: ';
$output .= $imagick->getImageMimeType();

return $output;
//Example end
}

public static function getParamType(): string
{
return ImageControl::class;
}
}
1 change: 1 addition & 0 deletions src/example_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ function getImagickExamples()
//'getImageMagickLicense',
//'getImageMatte',
//'getImageMatteColor',
'getImageMimeType' => 'getImageMimeType',
//'getImageOrientation',
//'getImagePage',
//'getImagePixelColor',
Expand Down

0 comments on commit 9df6cef

Please sign in to comment.