One Pass : -jpegtrans exif & Resize

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

Moderators: helmut, XnTriq, xnview

Post Reply
zebulaon
Posts: 3
Joined: Thu Oct 07, 2010 9:14 pm

One Pass : -jpegtrans exif & Resize

Post by zebulaon »

Hi,
Firstly, congratulations and thank you for this remarkable program.
That is my question: I'd like in one pass return and resize multiple images in a folder source. (For the rotation I'd like to use the Exif information.)
Here is my command line: (-keepfiledate -jpegtrans exif)

Code: Select all

"E:\Program Files\nconvert\nconvert.exe" -q 90  -out jpeg -o "C:\phpwebgallery\DirWorkingFTP\%.jpg" -ratio -rtype lanczos -rflag decr  -resize 800 800 -keepfiledate -jpegtrans exif C:\phpwebgallery\DirWorkingFTP\testing\pwg_high\*.jpg 
My problem is that only pictures that are returned are resized, they are not returned resized. (They are ignored! nconvert says : NO NEED)
First is this possible? and if so, could someone fix command line syntax
Thank's
marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Re: One Pass : -jpegtrans exif & Resize

Post by marsh »

I don't see Exif information listed as part of normal image processing functions. Please note that jpeg operations are special. -jpegtrans and -jpegcrop write to files directly (cf. warning dialog in GUI version).

nconvert.exe -jpegtrans exif test.jpg
(directly rotate original according to exif tag)
User avatar
maesehn
Posts: 5
Joined: Sun Jan 09, 2011 5:28 pm

Re: One Pass : -jpegtrans exif & Resize

Post by maesehn »

Hi,
same problem here! :?
My objective is to reduce in size multiple pictures at the same time to send them easily by email. Pictures are all original, straight from the camera! :D
Because i'm new to nConvert, i tried to add each command line switch one at a time to understand exactly how it works. Everything worked fine until i add the “-jpegtrans exif” switch:

Code: Select all

nconvert.exe -ratio -resize 2048 2048 -jpegtrans exif -keepfiledate -rmeta -o photo-##.jpg *.jpg
The result of this command is:
  • - all the output pictures are renamed (good)
    - none of them are resized (bad)
    - none of them have their metadata removed (bad)
    - pictures that have to be rotated are rotated (good)
    - only the ones that were rotated kept their timestamps, not the other ones (quite bad)
I tried to move the “-jpegtrans exif” switch at different positions (i read about that in another post) but none of my tries were successfull… :(

My question is: Am i doing something wrong (if so, can anyone help me please?)
or will i have to (as zebulaon suggests) do multiple passes to obtain my reduced pictures?

Thanks for any help! :wink:

PS: i spend hours to guess how to add leading zeros on the outpout filenames, it should be added to the help file (OK, i will tell about this in the documentation section).
marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Re: One Pass : -jpegtrans exif & Resize

Post by marsh »

maesehn wrote: Because i'm new to nConvert, i tried to add each command line switch one at a time to understand exactly how it works. Everything worked fine until i add the “-jpegtrans exif” switch:
Jpeg lossless transformations directly write to files, and should be seperate from standard image manipulations like resize, crop, or rotate. original-file>original-file vs. input>output-file.
User avatar
maesehn
Posts: 5
Joined: Sun Jan 09, 2011 5:28 pm

Re: One Pass : -jpegtrans exif & Resize

Post by maesehn »

Problem #1
marsh wrote: Jpeg lossless transformations directly write to files
I didn't understand what you meant until i made some more testing:
Because i created output files with “-o photo-##.jpg”, the original files remained in an absolutly virginal state! (That's why your answers made me puzzled!) So i tried this simple command you gave in post #2:

Code: Select all

nconvert.exe -jpegtrans exif *jpg
and you're right: :D the pictures that have to be rotated are rotated and they are overwrited!
That's problem #1 (helmut talks about it in his new topic): unlike the other switches, “-jpegtrans” doesn't need for the “-overwrite” switch, it just does it! by default! But if an output name is specified, the lossless transformation is made on the output file not on the source… :| All that is really confusing wether you are a geek or a newbie.

Problem #2
Few switches are compatible with “-jpegtrans”, i mean, let's remember my complete command line in post #3: as soon as i added the “-jpegtrans” switch, “-resize” & “-rmeta” didn't work anymore and “-keepfiledate” gave some strange results…

Solution
So, as for now, it seems that there is no way to “lossless-rotate” and resize in one and only pass.
The better solution i found is to run two commands one after another, as in the exemple below:
- first command to run (lossless rotation)

Code: Select all

nconvert.exe -jpegtrans exif -keepfiledate *.jpg
- second command to run (reducing file size)

Code: Select all

nconvert.exe -ratio -resize 2048 2048 -keepfiledate -rmeta -o photo-##.jpg *.jpg
It works fine but it's not user friendly, maybe we could add this to the bug/feature request list?
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: One Pass : -jpegtrans exif & Resize

Post by xnview »

maesehn wrote: Problem #2
Few switches are compatible with “-jpegtrans”, i mean, let's remember my complete command line in post #3: as soon as i added the “-jpegtrans” switch, “-resize” & “-rmeta” didn't work anymore and “-keepfiledate” gave some strange results…
Ok, but when apply lossless operation? Before all others??
Pierre.
Post Reply