Perhaps a better request would be to have Sigil inspect the images during import to determine if the file type and image type match. I've seen the imghdr Python library used for testing and supplying information for renaming if needed (not sure but think Python3 required).
OTOH, when importing files with the wrong file type—"Garbage in, Garbage out" comes to mind—it might be better for the user to do some work before importing the image files. I might just be showing my paranoia but I tend to get nervous about files with incorrect file types. Am I the only one who remembers various forms of malware that hid themselves within images where one tactic was changing the image file type. It's a .png not a .jpeg so we won't check the EXIF data for instance.
@The_book: Since you know changing the file type when renaming the image file is going to trigger the mimetype error, why not change the mimetype at the same time?
Last edited by DNSB; 02-15-2020 at 12:28 AM.
|