I'm not sure how or why this got changed from the original code, but at some point the code to determine if a file is an image changed from using gtk.gdk.pixbuf_get_file_info(path) to testing the file extension. I tend to have image files without file extensions and so I've had a copy of comix on my system just for that. But I got tired of it and so I dug into the code and fixed it. I can't imagine how this could cause any errors, but I could be wrong. This patch really just replaces the current is_image_file(path) functon with the one from the original comix.This has been bugging me for a while so I just figured I'd try and fix it.
Well, it's been a pretty long time, but the commit log tells me I changed the function for performance reasons in 2011. Most likely because calling stat(), fread() and so on to determine the file type on each file in a directory is a huge I/O drain, especially if reading from a network share or the directory contains many files.
I can understand that it might be a performance issue, but at the same time it means the program doesn't work correctly. If I open an image file it shouldn't matter what the extension is. In my opinion it's a bug that mcomix doesn't work that way. Perhaps it could default to the current behavior but have an option to change to the alternate means of determining file type?
Oddegamra-
If the performance impact is great enough it makes sense to look at the
file extension for a lightweight hack.
However, it would seem there is no issue allowing users the option to
accept the performance hit in order that MComix performs more "correctly".
On Jan 18, 2014 10:20 AM, "Tucker DiNapoli" hitchiker42@users.sf.net
wrote: