Page 1 of 1

Using a xbs file as an input to NConvert

Posted: Wed Nov 14, 2018 2:14 am
by marcgii
So I have a xbs file which has the complete convert configuration I want to use. Can use this file as a input to nConvert? It doesn't seem that I can. I had also hoped to use the export to batch function, but that doesn't include any of the output format options. It only included the resize options.

At the moment, all I'm trying to do is convert and resize a single specified image, and specify the output location. What is the best way to accomplish this using only scripts? If the only way is figuring out the nconvert syntax, can someone assist? I didn't find the "user guide" to be particularly helpful.

Below is basically what I have so far. It doesn't work right. I have attached a screenshot of xbs config file. Any help would be appreciated.

Code: Select all

nconvert -out jpeg -q 75 -opthuff -dct value 2 -smoothingf value 0 -subsampling value 2 -keepcspace -ratio -rtype lanczos -rflag decr -resize 10000 2800  -o "D:\Test\output.jpeg" "D:\Test\input.png"

Re: Using a xbs file as an input to nConvert?

Posted: Wed Nov 14, 2018 7:19 pm
by cday
marcgii wrote: Wed Nov 14, 2018 2:14 am So I have a xbs file which has the complete convert configuration I want to use. Can use this file as a input to nConvert? It doesn't seem that I can. I had also hoped to use the export to batch function, but that doesn't include any of the output format options. It only included the resize options.
I have no experience of the xbs export option, and as you say the export for NConvert option doesn't include the required input and output code. However, those shouldn't be hard to add. I believe the code exported from batch convert also often includes terms that are not in fact needed, possibly because the values are default values when NConvert is run.

At the moment, all I'm trying to do is convert and resize a single specified image, and specify the output location. What is the best way to accomplish this using only scripts? If the only way is figuring out the nconvert syntax, can someone assist?
I would suggest that you start by getting a minimal code running, and then add additional options one by one until you have final code that meets your needs. The following code that just reads the source PNG file and outputs a similar JPEG file should run without any difficulty: if it doesn't, stop and describe the problem you encounter if you are unable to overcome it.

Code: Select all

nconvert -out jpeg -q 75  -o "D:\Test\output.jpeg" "D:\Test\input.png"

When that code runs add the required resize option, and when that works any other options you actually need one by one; if you encounter a problem stop and try to overcome it, if necessary by liberal use of trial and error experimentation, and then if necessary post the issue you have encountered.

Note: If you don't have a copy of the NConvert help file you should create one, or if necessary consult the [least out of date] version in the NConvert section of the forum.

Re: Using a xbs file as an input to NConvert

Posted: Thu Nov 15, 2018 9:01 am
by xnview
no you need to export the xbs as a nconvert bat

Re: Using a xbs file as an input to NConvert

Posted: Sat Nov 17, 2018 2:14 pm
by marcgii
It turns out the issue with the code was simply that I had the switches wrong. If anyone is curious the correct is:

Code: Select all

nconvert -out jpeg -q 75 -opthuff -dct 2 -smoothingf 0 -subsampling 2 -keepcspace -ratio -rtype lanczos -rflag decr -resize 10000 2800  -o "D:\Test\output.jpeg" "D:\Test\input.png"

Re: Using a xbs file as an input to NConvert

Posted: Sat Nov 17, 2018 2:17 pm
by marcgii
xnview wrote: Thu Nov 15, 2018 9:01 am no you need to export the xbs as a nconvert bat
As I mentioned before, the export to Batch file function doesn't export image conversion settings. So what exactly is the intended use case for the function?

Re: Using a xbs file as an input to NConvert

Posted: Tue Nov 20, 2018 7:13 am
by xnview
marcgii wrote: Sat Nov 17, 2018 2:17 pm
xnview wrote: Thu Nov 15, 2018 9:01 am no you need to export the xbs as a nconvert bat
As I mentioned before, the export to Batch file function doesn't export image conversion settings. So what exactly is the intended use case for the function?
yes only actions. But what do you want to do? You would like to use your .xbs as command lie?

Re: Using a xbs file as an input to NConvert

Posted: Thu Nov 22, 2018 12:01 am
by marcgii
xnview wrote: Tue Nov 20, 2018 7:13 am yes only actions. But what do you want to do? You would like to use your .xbs as command lie?
Okay so it's only actions. It would be nice if it could also export your conversion configuration settings. I don't see any reason to limit the export function to only actions. If I could use the .xbs file (which includes actions and encoder settings) as an input, that would have been a work around to get nconvert working without having spend much time figuring out the needed commands and syntax. That's the reason I was asking.

Re: Using a xbs file as an input to NConvert

Posted: Fri Nov 30, 2018 11:14 am
by xnview
ok, i'll check to save output format settings