In YACReader 10.4.0 Flatpak on Linux, a valid CBR fails to open with “Unknown error opening the file”, and its cover thumbnail cannot be generated.
The libarchive backend returns an internal directory named JPEG without a trailing slash. FileComic::isSupportedImage() accepts any name ending in jpeg, so it mistakenly treats this directory as an image.
The directory sorts before the actual images and is selected as the cover. Reading its empty contents triggers the error.
Expected behavior: exclude directories from comic pages and match complete file extensions, including the dot.
Minimal test case: attached bug-JPEG.cbr, containing one valid PNG and an explicit directory entry:
Code:
$ unrar l bug-JPEG.cbr
Attributes Size Name
----------- --------- ----------------
..A.... 1701 JPEG/001.png
...D... 0 JPEG
----------- --------- ----------------
1701 2 entries
File link:
file.kiwi/dbf00e24#iD25HzSELnr6c8jkxt3lAw
Affected code in 10.4.0