Closed lanzagar closed 2 years ago
Merging #208 (607cf3a) into master (a3e7785) will increase coverage by
0.11%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #208 +/- ##
==========================================
+ Coverage 68.97% 69.08% +0.11%
==========================================
Files 17 17
Lines 2830 2834 +4
Branches 434 436 +2
==========================================
+ Hits 1952 1958 +6
+ Misses 769 768 -1
+ Partials 109 108 -1
There is a possibility of getting the set of all supported formats from Pillow:
from PIL import Image
exts = Image.registered_extensions()
supported_extensions = {ex for ex, f in exts.items() if f in Image.OPEN}
The discussion I opened is here: https://stackoverflow.com/questions/71112986/retrieve-a-list-of-supported-read-file-extensions-formats/71114152#71114152
I added the list of all PIL supported formats (which is vast), but then I realized that whether the image can be open or not is checked by QImageReader, which supports the following formats.
ImageEmbedder uses PIL to load images, but Image Viewer and Image Grid use QImageReader to load images to show in the widget. Anyway, the list was missing BMP, which Qt also supports.
So we have two options here:
If we decide on the latest, I suggest deprecating the formats
attribute of the ImportImages
class and removing the DefaultFormats
list and only checking whether an image can be open QImageReader.
@lanzagar, it is ready for review. The test that is failing were failing before already and does not have anything to do with changes
Issue
The Import Images widget did not support loading .bmp image files.
Description of changes
Add support for BMP and other formats supported by QImageReader. In this PR we remove the hardcoded list of all available formats. Supported formats are now limited only to formats supported by QImageReader (before we limited formats with a predefined list of supported extensions and QImageReader).
Includes