File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ class MediaCategories:
207
207
".rw2" ,
208
208
}
209
209
_IMAGE_VECTOR_SET : set [str ] = {".svg" }
210
- _IMAGE_SET : set [str ] = {
210
+ _IMAGE_RASTER_SET : set [str ] = {
211
211
".apng" ,
212
212
".avif" ,
213
213
".bmp" ,
@@ -392,9 +392,14 @@ class MediaCategories:
392
392
extensions = _IMAGE_VECTOR_SET ,
393
393
is_iana = False ,
394
394
)
395
+ IMAGE_RASTER_TYPES : MediaCategory = MediaCategory (
396
+ media_type = MediaType .IMAGE ,
397
+ extensions = _IMAGE_RASTER_SET ,
398
+ is_iana = False ,
399
+ )
395
400
IMAGE_TYPES : MediaCategory = MediaCategory (
396
401
media_type = MediaType .IMAGE ,
397
- extensions = _IMAGE_SET | _IMAGE_RAW_SET | _IMAGE_VECTOR_SET ,
402
+ extensions = _IMAGE_RASTER_SET | _IMAGE_RAW_SET | _IMAGE_VECTOR_SET ,
398
403
is_iana = True ,
399
404
)
400
405
INSTALLER_TYPES : MediaCategory = MediaCategory (
Original file line number Diff line number Diff line change @@ -625,13 +625,7 @@ def update_widgets(self) -> bool:
625
625
self .preview_gif .show ()
626
626
627
627
image = None
628
- if (
629
- MediaCategories .is_ext_in_category (ext , MediaCategories .IMAGE_TYPES )
630
- and MediaCategories .is_ext_in_category (ext , MediaCategories .IMAGE_RAW_TYPES )
631
- and MediaCategories .is_ext_in_category (
632
- ext , MediaCategories .IMAGE_VECTOR_TYPES
633
- )
634
- ):
628
+ if MediaCategories .is_ext_in_category (ext , MediaCategories .IMAGE_RASTER_TYPES ):
635
629
image = Image .open (str (filepath ))
636
630
elif MediaCategories .is_ext_in_category (ext , MediaCategories .IMAGE_RAW_TYPES ):
637
631
try :
@@ -668,7 +662,7 @@ def update_widgets(self) -> bool:
668
662
# Stats for specific file types are displayed here.
669
663
if image and (
670
664
MediaCategories .is_ext_in_category (
671
- ext , MediaCategories .IMAGE_TYPES , mime_fallback = True
665
+ ext , MediaCategories .IMAGE_RASTER_TYPES , mime_fallback = True
672
666
)
673
667
or MediaCategories .is_ext_in_category (
674
668
ext , MediaCategories .VIDEO_TYPES , mime_fallback = True
You can’t perform that action at this time.
0 commit comments