From a966134aa6dac1f7ffd98b6fe2d4b1b0a1367969 Mon Sep 17 00:00:00 2001 From: Tomasz Kryszan Date: Mon, 23 Oct 2023 11:31:51 +0200 Subject: [PATCH] Added mime field to ezimage field type --- src/lib/FieldType/Image/Type.php | 2 ++ src/lib/FieldType/Image/Value.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/lib/FieldType/Image/Type.php b/src/lib/FieldType/Image/Type.php index c369118406..ef84995998 100644 --- a/src/lib/FieldType/Image/Type.php +++ b/src/lib/FieldType/Image/Type.php @@ -323,6 +323,7 @@ public function toHash(SPIValue $value) 'width' => $value->width, 'height' => $value->height, 'additionalData' => $value->additionalData, + 'mime' => $value->mime, ]; } @@ -387,6 +388,7 @@ public function fromPersistenceValue(FieldValue $fieldValue) ? $fieldValue->data['height'] : null), 'additionalData' => $fieldValue->data['additionalData'] ?? [], + 'mime' => $fieldValue->data['mime'] ?? null, ] ); diff --git a/src/lib/FieldType/Image/Value.php b/src/lib/FieldType/Image/Value.php index 4ca142d03b..d5cb87384a 100644 --- a/src/lib/FieldType/Image/Value.php +++ b/src/lib/FieldType/Image/Value.php @@ -93,6 +93,9 @@ class Value extends BaseValue /** @var string[] */ public $additionalData = []; + /** @var string|null */ + public $mime; + /** * Construct a new Value object. */