Please pad the file name auto-numbering, when saving multipole pages.

Bug #1180154 reported by Nathan Hartley
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Simple Scan
Fix Released
Medium
Victor Mireyev

Bug Description

Right now the files are saved with the following naming pattern name-#.ext . It would be helpful when working with other applications to have the files padded so they sort alphabetically in the correct order, like so name-####.ext .

Thank you.

Tags: wishlist
Michael Nagel (nailor)
Changed in simple-scan:
status: New → Triaged
Changed in simple-scan:
status: Triaged → In Progress
assignee: nobody → Victor Mireyev (victor-mireyev)
Revision history for this message
Michael Nagel (nailor) wrote :

is it good that the number of digit (4 at this point) is hardcoded.
generally i'd think using as many as needed (depending on the biggest number to be used (aka number of pages)) would be better. this would possibly be problematic when a document grows from 9 to 10 pages, however.

Revision history for this message
Victor Mireyev (victor-mireyev) wrote :

Please review push request with adaptive zero padding.

Revision history for this message
Michael Nagel (nailor) wrote :

I meant that it should be discussed if the padding should be adaptive.
it might be better (in most cases) but it might be worse (as stated above -- number of pages changes).
so i am not really sure what to do.

about the code: i do not really understand what you do.
why do have a loop instead of doing:

width = get_n_pages ().to_string().length;
number_format = "%%0%dd".printf(width)
filename = prefix + "-" + number_format.printf(i+1) + suffix
return File.new_for_uri (filename)

Revision history for this message
Victor Mireyev (victor-mireyev) wrote :

In fact file names are adaptive in SimpleScan. For example, a single-page document doesn't have numbering at all.

Revision history for this message
Victor Mireyev (victor-mireyev) wrote :

Hi Michael, you're right, loop isn't necessary in this case.

Revision history for this message
Victor Mireyev (victor-mireyev) wrote :

Hi Michael, I've personally stumbled upon problem with file name sorting without padding. So I'm sure it would be useful improvement of SimpleScan program.

By the way very popular and well know programs such as ABBYY FineReader and ScanTailor also provide zero padding feature, but in fixed and not adaptive variant.

Changed in simple-scan:
status: In Progress → Fix Committed
importance: Undecided → Medium
Changed in simple-scan:
status: Fix Committed → Fix Released
milestone: none → 3.9.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.