-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bitmaps #8
Comments
First of all thanks for your great work on Pim, I have highly enjoyed working with the codebase. I did a quick debug on this. Looks like not all .bmp mimetypes are included in GdkPixbuf.Pixbuf.get_formats(). In my specific case, I tested with a few bitmaps exported from gimp, the "image/x-ms-bmp" type was missing. Simply appending that type to the supported ones solved the issue. The problem is, I have no idea how many more types are missing and how one could find out what they are. |
Such kind words :D Although James Campos (aeosynth) should be praised mostly. As I just worked on his ToDo entries later. And thanks for debugging this. Currently I don't have the time to check on this. Maybe some kind of regex, if the first check returned as unsupported, check if there are similar ones --> will be added and failure will be sorted out later as it could be covered by the routine with broken images. |
can you share some failing bitmaps? would checking extension (.bmp) instead of mime type fix this? |
https://paste.archlinux.de/m-gObM/ Well. Checking the extension would open the problem with non image files with an .bmp ending (for whatever reason those could exist) Edit: Or without any extension |
those have the type |
Just for sharing information: I had someone open an issue for opening images without any extension In general I agree with him, just filtering images by mimetype is not very sophisticated. Using the imghdr module might be a better alternative. I plan on testing that sometime this or next month, still pretty busy at the moment. If it works and you are interested, I could probably implement a PR for Pim afterwards as well. |
you'd have to convince me by showing images which are only recognizable with that module |
Got to it earlier than expected. Say you have a correct imagefile called "myimage" and a textfile called "text.png". The extension version wouldn't work whereas imghdr filters correctly. As the opened issue shows the first case happens, the second one is rather esoteric but nice to be protected against. Sure, one could rename the files manually, but this shouldn't be necessary. I have yet to find a file that imghdr does not handle correctly. |
what about the mimetype version? i'd like to see real images which are detected differently |
Just rename any images of your choice accordingly 😃 I don't have a favourite pastebin yet... |
oh, i thought |
http://lazka.github.io/pgi-docs/GdkPixbuf-2.0/classes/Pixbuf.html#GdkPixbuf.Pixbuf.get_file_info
i believe this can be used instead of |
Nice catch! First tests with it seem to go perfectly well. |
Stumpled upon bitmaps (.bmp) and was kinda suprised pim didn't open those.
Explicit calling those behaved like giving a directory
The text was updated successfully, but these errors were encountered: