+ * Save a new image from an existing image data string.
+ *
+ * @throws ImageUploadException
+ */
+ public function saveNewFromData(string $imageName, string $imageData, string $type, int $uploadedTo = 0): Image
+ {
+ $image = $this->imageService->saveNew($imageName, $imageData, $type, $uploadedTo);
+ $this->imageResizer->loadGalleryThumbnailsForImage($image, true);
+
+ return $image;
+ }
+
+ /**
+ * Save a drawing in the database.
+ *