Skip to content
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

Support case insensitive image extensions #86

Open
CsatiZoltan opened this issue Feb 18, 2020 · 2 comments
Open

Support case insensitive image extensions #86

CsatiZoltan opened this issue Feb 18, 2020 · 2 comments

Comments

@CsatiZoltan
Copy link
Contributor

I realized that I couldn't find an image file with .PNG extension. It is because ImagePy only loads .png (i.e. with lower case). You could consider accepting upper case extensions too.

@yxdragon
Copy link
Member

I had tested it in deepin linux, and I both png and PNG is OK, what's your os?

@CsatiZoltan
Copy link
Contributor Author

If I use File -> Open, then only the images with lowercase extensions are listed. You can check it by investigating the fifth element of the list ls here:

ls = [cls.reader[i].keys() for i in cls.reader.keys()]

To me, it shows

dict_keys(['jpg', 'jpeg', 'dat', 'dcm', 'npy', 'tif', 'tiff', 'mat', 'png', 'gif', 'bmp'])

On the other hand, File -> PNG -> PNG Open gives 'PNG files (*.PNG)|*.PNG' in the filt variable:

filt = '|'.join(['%s files (*.%s)|*.%s'%(i.upper(),i,i) for i in self.filt])
resulting in (see the red highlighting):
Extension
I don't think it matters, but I work on Ubuntu 18.04 with Gnome 3 desktop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants