From 1123f5281d759c18e6d728859a07acdb34ac7a92 Mon Sep 17 00:00:00 2001 From: trendschau Date: Wed, 16 Apr 2025 15:19:57 +0200 Subject: [PATCH] 2.16.0 finish, fix media gd problem with docker --- cache/timer.yaml | 2 +- .../00-getting-started/01-edit-your-page.md | 3 --- content/index.md | 3 +++ media/custom/.gitkeep | 0 system/typemill/Models/Media.php | 22 +++++++++++++++++-- system/typemill/settings/defaults.yaml | 2 +- 6 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 media/custom/.gitkeep diff --git a/cache/timer.yaml b/cache/timer.yaml index 429d722..01e6693 100644 --- a/cache/timer.yaml +++ b/cache/timer.yaml @@ -1 +1 @@ -licenseupdate: 1744746578 +licenseupdate: 1744809148 diff --git a/content/00-getting-started/01-edit-your-page.md b/content/00-getting-started/01-edit-your-page.md index 9cd5a47..413c5b6 100644 --- a/content/00-getting-started/01-edit-your-page.md +++ b/content/00-getting-started/01-edit-your-page.md @@ -10,8 +10,5 @@ The content is organized in blocks, and you can move each content block up and d You can add all kinds of content like tables, quotes, images, files, an automatic table of contents (TOC), or YouTube videos. There are also plugins to embed media from other platforms or to use selected HTML tags in content. -![](media/live/chatgpt-typemill-dummy-wide.webp){.center loading="lazy" width="820" height="470"} -*Just a dummy image* - If you are a developer, you can write plugins and integrate nearly everything into the editor with `{::]` shortcodes. diff --git a/content/index.md b/content/index.md index f89146c..4025593 100644 --- a/content/index.md +++ b/content/index.md @@ -4,3 +4,6 @@ Typemill is a lightweight, flat-file CMS designed for simple, fast, and flexible Stay in the loop and subscribe to the [Typemill newsletter](https://typemill.net/news)! +![](media/live/chatgpt-typemill-dummy-wide.webp){.center loading="lazy" width="820" height="470"} +*Just a dummy image* + diff --git a/media/custom/.gitkeep b/media/custom/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/system/typemill/Models/Media.php b/system/typemill/Models/Media.php index f62e09d..c83250d 100644 --- a/system/typemill/Models/Media.php +++ b/system/typemill/Models/Media.php @@ -288,6 +288,11 @@ class Media { # transform image-stream into image $image = $this->createImage(); + + if(!empty($this->errors)) + { + return false; + } $originalsize = $this->getImageSize($image); @@ -418,7 +423,14 @@ class Media public function createImage() { - return imagecreatefromstring($this->filedata); + $image = imagecreatefromstring($this->filedata); + if(!$image) + { + $this->errors[] = Translations::translate('Could not create image from string. File corrupted, unsupported extension or gd-library not configured for extension.'); + return false; + } + + return $image; } public function getImageSize($image) @@ -643,8 +655,14 @@ class Media case 'webp': $image = imagecreatefromwebp($imagePath); break; default: return 'image type not supported'; } + + if(!$image) + { + $this->errors[] = Translations::translate('Could not create image from string. File corrupted, unsupported extension or gd-library not configured for extension.'); + return false; + } - return $image; + return $image; } diff --git a/system/typemill/settings/defaults.yaml b/system/typemill/settings/defaults.yaml index bd81190..1337569 100644 --- a/system/typemill/settings/defaults.yaml +++ b/system/typemill/settings/defaults.yaml @@ -1,4 +1,4 @@ -version: '2.15.0' +version: '2.16.0' title: 'Typemill' author: 'Unknown' copyright: false