From 7bf015644385f4005350e8b2f86be05ed88419bf Mon Sep 17 00:00:00 2001 From: trendschau Date: Tue, 22 Apr 2025 14:52:10 +0200 Subject: [PATCH] fixed bug with direct published images in meta, favicons, wrong cropping with black border --- cache/timer.yaml | 2 +- .../00-getting-started/00-create-your-first-page.yaml | 1 + content/00-getting-started/index.yaml | 3 ++- content/index.md | 1 - content/index.yaml | 5 +++-- media/tmp/.gitkeep | 0 system/typemill/Controllers/ControllerApiImage.php | 4 ++-- system/typemill/Models/Media.php | 6 +++--- system/typemill/author/js/vue-blox-components.js | 2 +- system/typemill/author/js/vue-forms.js | 10 +++++----- 10 files changed, 18 insertions(+), 16 deletions(-) delete mode 100644 media/tmp/.gitkeep diff --git a/cache/timer.yaml b/cache/timer.yaml index a7e5769..dc75511 100644 --- a/cache/timer.yaml +++ b/cache/timer.yaml @@ -1 +1 @@ -licenseupdate: 1744847559 +licenseupdate: 1745325860 diff --git a/content/00-getting-started/00-create-your-first-page.yaml b/content/00-getting-started/00-create-your-first-page.yaml index 9446790..50d09e2 100644 --- a/content/00-getting-started/00-create-your-first-page.yaml +++ b/content/00-getting-started/00-create-your-first-page.yaml @@ -2,6 +2,7 @@ meta: navtitle: 'create your first page' title: 'Create Your First Page' description: "To create a new page in Typemill, follow these simple steps: \nUse the interactive navigation located on the left side of the screen. \nEnter a page title for" + heroimage: '' owner: trendschau author: 'Sebastian Schürmanns' modified: '2024-04-27' diff --git a/content/00-getting-started/index.yaml b/content/00-getting-started/index.yaml index 9ad1d6a..5752060 100644 --- a/content/00-getting-started/index.yaml +++ b/content/00-getting-started/index.yaml @@ -2,6 +2,7 @@ meta: navtitle: 'getting started' title: 'Getting Started with Typemill' description: 'Use this demo-content to familiarize yourself with Typemill. Not sure where to start?' + heroimage: media/live/web-optimized-1200x800-97kb.jpg owner: trendschau author: 'Sebastian Schürmanns' modified: '2024-05-17' @@ -10,4 +11,4 @@ meta: hide: false noindex: false contains: pages - template: '' \ No newline at end of file + template: '' diff --git a/content/index.md b/content/index.md index 4025593..76e13f0 100644 --- a/content/index.md +++ b/content/index.md @@ -5,5 +5,4 @@ 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/content/index.yaml b/content/index.yaml index b6fa986..04e6aca 100644 --- a/content/index.yaml +++ b/content/index.yaml @@ -2,10 +2,11 @@ meta: navtitle: Home title: Typemill description: 'The open-source flat-file cms for text-driven websites. Create handbooks, documentations, manuals, web-novels, traditional websites, and more.' + heroimage: '' owner: typemill author: typemill - modified: '2024-04-25' + modified: '2025-04-22' created: '2024-03-19' time: 17-56-00 hide: false - noindex: false \ No newline at end of file + noindex: false diff --git a/media/tmp/.gitkeep b/media/tmp/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/system/typemill/Controllers/ControllerApiImage.php b/system/typemill/Controllers/ControllerApiImage.php index 9ff0a0c..4dfae6e 100644 --- a/system/typemill/Controllers/ControllerApiImage.php +++ b/system/typemill/Controllers/ControllerApiImage.php @@ -191,7 +191,7 @@ class ControllerApiImage extends Controller { $response->getBody()->write(json_encode([ 'message' => Translations::translate('Image saved successfully'), - 'name' => 'media/live/' . $media->getFullName(), + 'path' => 'media/live/' . $media->getFullName(), ])); return $response->withHeader('Content-Type', 'application/json'); @@ -239,7 +239,7 @@ class ControllerApiImage extends Controller { $response->getBody()->write(json_encode([ 'message' => Translations::translate('Image saved successfully'), - 'name' => 'media/tmp/' . $media->getFullName(), + 'path' => 'media/tmp/' . $media->getFullName(), ])); return $response->withHeader('Content-Type', 'application/json'); diff --git a/system/typemill/Models/Media.php b/system/typemill/Models/Media.php index c83250d..395f9b3 100644 --- a/system/typemill/Models/Media.php +++ b/system/typemill/Models/Media.php @@ -459,12 +459,12 @@ class Media { # resize $ratio = max( - $desired['width']/$original['width'], - $desired['height']/$original['height'] + $desired['width'] / $original['width'], + $desired['height'] / $original['height'] ); # prevent upscaling - $ratio = ($ratio > 1) ? 1 : $ratio; + # $ratio = ($ratio > 1) ? 1 : $ratio; $w = $desired['width'] / $ratio; $h = $desired['height'] / $ratio; diff --git a/system/typemill/author/js/vue-blox-components.js b/system/typemill/author/js/vue-blox-components.js index 64a2059..73a09b1 100644 --- a/system/typemill/author/js/vue-blox-components.js +++ b/system/typemill/author/js/vue-blox-components.js @@ -1958,7 +1958,7 @@ bloxeditor.component('image-component', { self.saveimage = true; self.imgmeta = true; - self.imgfile = response.data.name; + self.imgfile = response.data.path; if(self.imgwidth > 820) { diff --git a/system/typemill/author/js/vue-forms.js b/system/typemill/author/js/vue-forms.js index ac6f6d1..5742458 100644 --- a/system/typemill/author/js/vue-forms.js +++ b/system/typemill/author/js/vue-forms.js @@ -969,19 +969,19 @@ app.component('component-image', { tmaxios.post('/api/v1/image',{ 'image': e.target.result, 'name': imageFile.name, - 'publish': true, + 'publish': false, 'keepformat': keepformat }) .then(function (response) { - sharedself.update(response.data.name); - }) + sharedself.update(response.data.path); + }) .catch(function (error) { sharedself.load = false; if(error.response) { - console.info(error.response); -/* publishController.errors.message = error.response.data.errors; */ + console.info(error.response); + /* publishController.errors.message = error.response.data.errors; */ } }); }