Sumatrapdf: Comic Book Archive (*.CBX) page sequence issue

Created on 13 Nov 2016  路  8Comments  路  Source: sumatrapdfreader/sumatrapdf

As described here, if the comic container doesn't follow the use of preceding zeros for all positions (example: using 01 rather than 1) then the viewer rearranges the pages. Most of the desktop readers ignore this & correctly display the page sequence. Can it be possible to fix this in the next update?

I've prepared a dummy CBZ file as example: http://ge.tt/8c4a25h2

Please notice the page number footer to get the rearranging issue.

Most helpful comment

All 8 comments

+1 for natural sort order support.

This issue was recently brought up again on the forum, where @kjk replied:

Can you post a sample of the actual file names inside the .cbz file?

The problem here is that there are various ways to sort the names and a heuristic that works for one case might not work for another.

@kjk You can see the file linked to above for an example. Basically unless the requisite padding with leading zeroes is present Sumatra gets the sort order wrong. So we end up with something like 1.png, 10.png, 11.png, 2.png instead of the obvious correct (for humans) order.

You can see the references list of the Wikipedia article I've linked to above for more details if required. Martin Pool's algorithm might also be of interest to you: https://github.com/sourcefrog/natsort

Finally, I just want to note that even Windows Explorer has used natural sort by default since XP was released more than a decade-and-a-half ago, and every other decent modern sequential image viewer/comic book reader I know of has been using natural sort for ages.

Link to another discussion on the new forum.

Awesome, looking forward to the next stable release with this fix. :)

Looks like #1060 didn't fix this after all. :(

Forum discussion here @kjk @glachancecmaisonneuve

P.S. Here are 10 archives (2 each for 7z/CB7, RAR4/CBR, RAR5/CBR, TAR/CBT and ZIP/CBZ) for testing. The "Good" ones have all the images inside in proper order (pages 1 to 10), whereas the "Bad" ones have been created specifically with the images in the wrong order (pages 6 to 10, then 1 to 5).

Thanks @kjk, this indeed looks like it's been fixed. Here are 5 archives (1 each for 7z/CB7, RAR4/CBR, RAR5/CBR, TAR/CBT and ZIP/CBZ) for testing, and my test results can be found in the forum.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

deveee picture deveee  路  18Comments

philiparvidsson picture philiparvidsson  路  19Comments

suckerstate picture suckerstate  路  22Comments

kjk picture kjk  路  19Comments

pnsantos picture pnsantos  路  28Comments