jpg - bad output format?

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

Moderators: helmut, XnTriq, xnview

Post Reply
BabaG
Posts: 150
Joined: Sat Mar 03, 2007 6:41 am

jpg - bad output format?

Post by BabaG »

i ran the same command using a variable for the file extension and
all of the formats i tried worked fine with the exception of anything
jpg. tried bmp, cin, dpx, png, ppm, tga, tiff, maybe something else
but i can't remember now. all worked fine, ecept jp2, jpc, jpg all
returned the error 'bad output format.'

is there additional syntax that must be used for these formats?

(the version of nconvert is slightly older, not quite the current.)

thanks,
BabaG
User avatar
xnview
Author of XnView
Posts: 46362
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: jpg - bad output format?

Post by xnview »

You use

Code: Select all

-out jpg
?
Pierre.
BabaG
Posts: 150
Joined: Sat Mar 03, 2007 6:41 am

Re: jpg - bad output format?

Post by BabaG »

thanks pierre.

here's a snip from my command. the variable 'outformat' carries the 'jpg' value, as you've suggested.
as i said in the original post, this line works for all of the formats i use except for jpg and jpg related
formats.

"/usr/bin/nconvert -quiet -out " + outformat + " -high_res -raw_camerabalance -negate -levels " + scorrLvlToe + " " + scorrLvlShd + " -brightness " + scorrBri + " -contrast " + scorrCon + " -gamma " + scorrGam + " -balance " + scorrRed + " " + scorrGrn + " " + scorrBlu + " -hls " + scorrHue + " " + scorrLtn + " " + scorrSat + " -crop " + sCropX + " " + sCropY + " " + sCropW + " " + sCropH + " -bgcolor 0 0 0 -canvas " + sCanvasW + " " + sCanvasH + " " + CanvasPos + " -resize " + sResizeW + " " + sResizeH + " -o " + pdestination + "/" + fname + " " + receiving + "/" + tmp_pre_A + leadzero + frame_num_string + "." + capformat

the variables in use here are:

outformat = jpg in this case
scorrLvlToe = toe value of levels correction
scorrLvlShd = shoulder value of levels correction
scorrBri = brightness value correction
scorrCon = contrast value correction
scorrGam = gamma value correction
scorrRed = red value correction
scorrGrn = green value correction
scorrBlu = blue value correction
scorrHue = hue value correction
scorrLtn = lightness value correction
scorrSat = saturation value correction
sCropX = crop x position value
sCropY = crop y position value
sCropW = crop width
sCropH = crop height
sCanvasW = canvas width
sCanvasH = canvas height
CanvasPos = canvas position
sResizeW = resize width
sResizeH = resize height
pdestination = processed frame destination folder
fname = filename for processed frame
receiving = folder where nconvert finds the original frame
tmp_pre_A = first part of filename
leadzero = any leading zeroes in the original frame's filename
frame_num_string = frame number of original frame's filename
capformat = capture format (cr2, nef, jpg, etc.) of original frame

thanks and hope this helps track this down,
BabaG
User avatar
xnview
Author of XnView
Posts: 46362
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: jpg - bad output format?

Post by xnview »

For jpeg, it's '-out jpeg'
Pierre.
BabaG
Posts: 150
Joined: Sat Mar 03, 2007 6:41 am

Re: jpg - bad output format?

Post by BabaG »

unless it conflicts with something in the programming, it would be
convenient on this end if the parameters for the -out command
matched the extension for the filetype.

and, btw, that was indeed the problem. changed -out jpg to -out jpeg
and everything works fine now.

thanks,
BabaG
User avatar
helmut
Posts: 8704
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: jpg - bad output format?

Post by helmut »

BabaG wrote:unless it conflicts with something in the programming, it would be
convenient on this end if the parameters for the -out command
matched the extension for the filetype.
Supporting both jpg and jpeg as output format is a good idea. Also, the error message of nconvert should improved. E.g. instead of "Bad output format" the wording "Invalid output format". Would be clearer.

Message numbers
Also, each message should have a unique message number. Then, people can search the forum/help for that message number and find help easier.
Post Reply