fix: Don't optimize images implicitly (#26177)

Makes screenshots in comments unreadable with no way to opt out of it.
This commit is contained in:
Ankush Menat 2024-04-26 18:52:18 +05:30 committed by GitHub
parent dc64678625
commit 71dfffa7ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,7 +12,6 @@ import frappe
from frappe import _, safe_decode
from frappe.utils import cint, cstr, encode, get_files_path, random_string, strip
from frappe.utils.file_manager import safe_b64decode
from frappe.utils.image import optimize_image
if TYPE_CHECKING:
from PIL.ImageFile import ImageFile
@ -237,8 +236,6 @@ def extract_images_from_html(doc: "Document", content: str, is_private: bool = F
content = content.split(b",")[1]
content = safe_b64decode(content)
content = optimize_image(content, mtype)
if "filename=" in headers:
filename = headers.split("filename=")[-1]
filename = safe_decode(filename).split(";", 1)[0]