tmeiczin/OpenDCP — pull request #23 by patientstreetlight (2012-06-11 05:10:10+00:00)
Title: Order tiff files based on index.

Now correctly order files with names like:
prefix1.tif
prefix2.tif
.
.
.
prefix10.tif

In other words, relax the restriction that the files must be *lexicographically* sortable.
Every file is assumed to have a common (possibly empty) prefix followed by a decimal index.
(Do we also need to support hex indices as well?)

Errors caught:
* Missing index (e.g. prefix1.tif followed by prefix3.tif)
* The longest common prefix of all the files is not followed by an integer for some file in the list.

Testing done:
* Sorted 10 files with indices in various positions.
* Both types of errors generate log output.
* Valgrind clean.

Testing **not** done:
* That opendcp_j2k works in its entirety. During testing, I `exit` after properly sorting the files.