Create multipage file with correct page order

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

Post Reply
punith8626
Posts: 48
Joined: Thu Feb 02, 2017 11:22 am

Create multipage file with correct page order

Post by punith8626 »

Hello
if i have a file set like this 1.png,2.png.... 10.png, 11.png etc
If I execute below command I get results with pages as below.Resultent tif contains 1.png,10.png,11.png,2.png like that

Code: Select all

nconvert  -out  tiff -multi -c 7 -overwrite -o C:\tiff\ccc.tif C:\tiff\*.png
but I need to have somthing like 1.png,2.png,3.png... like this.

Is there any option in nconvert ?
cday
XnThusiast
Posts: 3973
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Create multipage file with correct page order

Post by cday »

punith8626 wrote: I have a file set like this 1.png,2.png.... 10.png, 11.png etc

If I execute below command I get results with pages as below. Resultent tif contains 1.png,10.png,11.png,2.png like that

Code: Select all

nconvert  -out  tiff -multi -c 7 -overwrite -o C:\tiff\ccc.tif C:\tiff\*.png
but I need to have something like 1.png,2.png,3.png... like this.

Is there any option in nconvert ?
The problem, as I understand it, is that code run at the command line in Windows uses the 'DOS' and early Windows non-numeric sort order, and there doesn't seem to be any way to change that... :(

The only solution I am aware of is to renumber the source files before using NConvert to add 'padding' so that the files are numbered 001 002 003 ... using a *Windows* renaming utility, of which there are many, although you should also be able to rename the files using the batch renaming tools in XnView Classic or MP.

Renaming the source files in NConvert or a command line renaming utility doesn't overcome the problem, as the same sort order issue arises so the files are again read in the 'wrong' order.
Post Reply