-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Imagick::getImageMimeType example.
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters