Issue: The image file mime type got converted to HEIC by Safari
To reproduce:
- Create an HTML file with
<input type="file" accept="image/*,image/heic" /> - Try to upload a photo with
.jpegor.png - Print out the file object
- The file name would be changed to some temporary name with
.heicextension
Expected:
- The conversion should not happen after adding the
image/heicto the accept mime type. - The accept mine type with
image/heicshould be allowed and cannot be removed for other modern browsers which do not support.heic. Otherwise, the system browse dialog would disable .heic type.
Other findings:
- If
image/heicis removed from the accept mime type, the file object would be printed out as its original extension. - It only happens with Safari 17+.
Original file object:
File: {
lastModified: 1702417372000,
name: "leo2.jpeg",
size: 170584,
type: "image/jepg",
webkitRelativePath: ""
}
Converted file object:
File: {
lastModified: 1702417636000,
name: "tempImageHjyd3l.heic",
size: 170429,
type: "image/heic",
webkitRelativePath: ""
}