Multipage TIFF with Powershell - Can't insert first line of filelist to output TIFF

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

Moderators: XnTriq, xnview

Post Reply
sergiokapone
Posts: 6
Joined: Sat Feb 02, 2019 6:24 pm

Multipage TIFF with Powershell - Can't insert first line of filelist to output TIFF

Post by sergiokapone » Fri Mar 08, 2019 7:31 pm

I want to convert some tiff's into multipage tiff with powershell.
I started script with

Code: Select all

powershell script.ps1 \Path\to\tiffs
Content of
script.ps1
is

Code: Select all

$path=$args[0]
$File = dir $path\*.tif | foreach {$_.name}
$File | Out-File debug.txt
nconvert.exe -overwrite -o binder.tiff -multi -out tiff -c 7 -l $File
Start-Sleep 100
And get error only for the first line of $File!
Error: Can't open file (II*)
and I get binder.tiff without first file of list.
Why nconvert does not get the first file of list? It does happen with any first file!
I use

Code: Select all

** NCONVERT v7.25 (c) 1991-2019 Pierre-E Gougelet (Jan 15 2019/12:05:55) **
        Version for Windows Xp/Vista/7 x64  (All rights reserved)
** This is freeware software (for non-commercial use)
Also

Code: Select all

Windows 10 x64 Pro 1809
The string
$File | Out-File debug.txt
write list into debug.txt in utf-16 encoding. May be, the problem is in the encoding of list?

cday
XnThusiast
Posts: 2231
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Nconvert: Multipage tiff with powershell. Can't insert first line of list to binder tiff

Post by cday » Sat Mar 09, 2019 6:33 pm

Please see this new thread which possibly relates to your problem... :?:

Post Reply