mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
implement image mime types support
This commit is contained in:
parent
8f6c27ed2b
commit
1086d48051
2 changed files with 46 additions and 6 deletions
|
|
@ -113,14 +113,20 @@ class Content
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* @TODO
|
case Filesystem::MIME_IMAGE_GIF:
|
||||||
case 'image/gif':
|
case Filesystem::MIME_IMAGE_JPEG:
|
||||||
case 'image/jpeg':
|
case Filesystem::MIME_IMAGE_PNG:
|
||||||
case 'image/png':
|
case Filesystem::MIME_IMAGE_WEBP:
|
||||||
case 'image/webp':
|
|
||||||
|
$document = new Image(
|
||||||
|
$this
|
||||||
|
);
|
||||||
|
|
||||||
|
$document->set(
|
||||||
|
$data
|
||||||
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
*/
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
|
|
|
||||||
34
src/Entity/Browser/Container/Page/Content/Image.php
Normal file
34
src/Entity/Browser/Container/Page/Content/Image.php
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Content;
|
||||||
|
|
||||||
|
use \Yggverse\Yoda\Entity\Browser\Container\Page\Content;
|
||||||
|
|
||||||
|
class Image
|
||||||
|
{
|
||||||
|
public \GtkImage $gtk;
|
||||||
|
|
||||||
|
// Dependencies
|
||||||
|
public Content $content;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
Content $content
|
||||||
|
) {
|
||||||
|
// Init dependency
|
||||||
|
$this->content = $content;
|
||||||
|
|
||||||
|
// Init image object
|
||||||
|
$this->gtk = new \GtkImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set(
|
||||||
|
string $data
|
||||||
|
): void
|
||||||
|
{
|
||||||
|
$this->gtk->new_from_resource(
|
||||||
|
$data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue