Input / Output for JPG lossless conversions

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

Moderators: helmut, XnTriq, xnview

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

Input / Output for JPG lossless conversions

Post by helmut »

JPG lossless conversions are directly applied on the original file, no output file is generated. This is confusing and a real breach in the clear and simple input/output concept of nconvert.

I wonder whether JPG conversions couldn't be handled as any other transformation: The original file could be copied and then the lossless transformation on the copied file could be applied. This way, the input/output concept of nconvert could be maintained while the JPG conversion still directly works on the file.
User avatar
maesehn
Posts: 5
Joined: Sun Jan 09, 2011 5:28 pm

Re: Input / Output for JPG lossless conversions

Post by maesehn »

Hi,
helmut wrote: The original file could be copied and then the lossless transformation on the copied file could be applied.
Actually i found a trick that allows you to do so. If you set an ouput name then the lossless transformation is applied to the output file not on the source:

Code: Select all

nconvert.exe -jpegtrans exif -o picture-#.jpg *.jpg
It seems that the “-jpegtrans” switch was not coded to only apply-transformation-to-the-source-file. It's only its default behavior: if it founds a counter-order (“set an output name” in the exemple above) then it is able to (it knows how to) apply the transformation to the output file. That's different from what we thought at first!
But that's not all, we discovered that there are more problems with this switch: it's impossible to run a resize command at the same time for example…
helmut wrote: This is confusing and a real breach in the clear and simple input/output concept of nconvert.
I agree. Not only the transformation is applied on the source file but the program don't ask a human confirmation for overwriting to the files (Unlike other conversions that need for the “-overwrite” switch).
Everything should be in harmony! :mrgreen:
marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Re: Input / Output for JPG lossless conversions

Post by marsh »

maesehn wrote: Everything should be in harmony! :mrgreen:
I think splitting it into 2 programs could be useful for that. :)
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Input / Output for JPG lossless conversions

Post by xnview »

Pierre.
marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Re: Input / Output for JPG lossless conversions

Post by marsh »

In v.5.85, jpeg lossless function can now create a seperate file!
Ex.
nconvert.exe -jpegtrans rot90 -o output.jpg input.jpg
(this one did not change original)

And overwriting original is still possible when no output file is specified.
Ex.
nconvert.exe -jpegtrans rot90 -overwrite test.jpg
(without overwrite command, it does not change original)
Post Reply