[FIX] hr_expense_report_merge_attachment: handle HEIC images uploaded as JPEG #19
Reference in New Issue
Block a user
No description provided.
Delete Branch "14.0-heif"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Some iPhone users upload HEIC files with a
.jpgextension. Odoo storesthe file as-is, but the mimetype is detected as
image/..., so the codeenters the image processing branch.
reportlab'sImageReaderrelieson
PIL.Image.open()which cannot identify HEIC files without an explicitplugin, causing a
PIL.UnidentifiedImageErrorand a 500 error on reportdownload.
Fix by:
pillow-heifopener at module load time (optionaldependency, silently ignored if not installed) so that Pillow can decode
HEIC/HEIF images.
ImageReader, bypassingreportlab's own format detection entirely.try/exceptto gracefully skipattachments that cannot be decoded, consistent with the existing PDF
error handling.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.