Hi!
I copied the same png to the same folder with names 00z.png and 00zz.png. (I did that just for this example. The problem exist with all kinds of different files that I tried so far.)
nconvert -out jpeg -ratio -resize 1024 00z*.png
Conversion of 00zz.png into 00zz.jpg OK
00zz.jpg gets created, but nothing else. No error messages either. If there are more files in the folder (more precisely: matching the search parameters), then only the first gets missed. If there is only one file, the it will not be processed, because it's the first.
Interestingly if I type the command incorrectly (-ratio after resize, which makes -ratio not work - the result image will be stretched):
nconvert -out jpeg -resize 1024 -ratio 00z*.png
Conversion of 00z.png into 00z.jpg OK
Conversion of 00zz.png into 00zz.jpg OK
00z.jpg and 00zz.jpg both gets created, but they are stretched, because -ratio wasn't applied.
I only tried it out on a windows xp 5.1.26 with Nconvert v7.39 (if Readme.txt is correct about that)
My guess is: When the internal task list gets created after entering the command, the first file somehow is excluded from it. I will try it on something newer.
Any help is appreciated.
Resize output not as expected
Moderators: XnTriq, helmut, xnview
-
- XnThusiast
- Posts: 4141
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: nconvert First file missing, first file unnoticed, fail to see first file
Don't you need a second parameter after -resize?vogoff wrote: ↑Fri Mar 26, 2021 8:54 pm I copied the same png to the same folder with names 00z.png and 00zz.png. (I did that just for this example. The problem exist with all kinds of different files that I tried so far.)
00zz.jpg gets created, but nothing else. No error messages either. If there are more files in the folder (more precisely: matching the search parameters), then only the first gets missed. If there is only one file, the it will not be processed, because it's the first.Code: Select all
nconvert -out jpeg -ratio -resize 1024 00z*.png Conversion of 00zz.png into 00zz.jpg OK
Code: Select all
-resize w h : Scale width-height
w h can be percent (ex: -resize 100% 200%)
-resize fill w h : Scale by filling the box wxh
-resize longest size : Scale longest side
-resize shortest size : Scale shortest side
-resize dpi value : Scale to DPI
You wish to resize all images to a width of 1024px while maintaining the existing aspect ratio, which presumably differs for different images?
Edit:
Assuming -ratio is intended for use with -resize, I can see how it might be used to resize to a width while maintaining the image aspect ratio, but not how it could be used to resize to a height maintaining the aspect ratio.
And the order -resize -ratio is probably correct, to output a multi-page PDF the sequence -out pdf -multi must be used.