diff --git a/frappe/public/icons/timeless/symbol-defs.svg b/frappe/public/icons/timeless/symbol-defs.svg
index 555ea6ee7e..6108daa938 100644
--- a/frappe/public/icons/timeless/symbol-defs.svg
+++ b/frappe/public/icons/timeless/symbol-defs.svg
@@ -702,7 +702,4 @@
-
-
-
diff --git a/frappe/public/js/frappe/file_uploader/FilePreview.vue b/frappe/public/js/frappe/file_uploader/FilePreview.vue
index 9e2fafb1e9..73adeb6fbb 100644
--- a/frappe/public/js/frappe/file_uploader/FilePreview.vue
+++ b/frappe/public/js/frappe/file_uploader/FilePreview.vue
@@ -20,9 +20,6 @@
-
@@ -31,6 +28,7 @@
{{ file.file_obj.size | file_size }}
+
diff --git a/frappe/utils/image.py b/frappe/utils/image.py
index 556c5e4a32..88d885e442 100644
--- a/frappe/utils/image.py
+++ b/frappe/utils/image.py
@@ -40,6 +40,9 @@ def strip_exif_data(content, content_type):
return content
def optimize_image(content, content_type, max_width=1920, max_height=1080, optimize=True, quality=85):
+ if content_type == 'image/svg+xml':
+ return content
+
image = Image.open(io.BytesIO(content))
image_format = content_type.split('/')[1]
size = max_width, max_height
@@ -48,5 +51,5 @@ def optimize_image(content, content_type, max_width=1920, max_height=1080, optim
output = io.BytesIO()
image.save(output, format=image_format, optimize=optimize, quality=quality, save_all=True if image_format=='gif' else None)
- content = output.getvalue()
- return content
\ No newline at end of file
+ optimized_content = output.getvalue()
+ return optimized_content if len(optimized_content) < len(content) else content
\ No newline at end of file