Page 1 of 1

-o creates wrong file extension

Posted: Tue Jan 04, 2022 2:30 pm
by midnightoil
In resizing a jpeg file, nconvert is ignoring the extension on the original source file and using 'jpg' instead.
For example:

Code: Select all

nconvert -resize longest 150 -o try.jpeg IMG_0132_2.jpeg > /dev/null
Conversion of IMG_0132_2.jpeg into try.jpg OK
The created file is "try.jpg" and not "try.jpeg".

I've tested this with Linux v7.98 and MacOS v6.88.

(The link to download the user guide is broken on the website)

Any suggestions?

Re: -o creates wrong file extension

Posted: Tue Jan 04, 2022 3:06 pm
by cday
Although the -o try.jpeg term defines the output filename, I think you may also need a -out JPEG term, although you are not in fact changing the file format... :?:

Otherwise, possibly related to this file extension error? recent unresolved reported issue.

Re: -o creates wrong file extension

Posted: Wed Jan 05, 2022 12:56 am
by midnightoil
Thanks, that seems to have fixed it!

It is not obvious from the help info. Might be mentioned in the manual but the link is broken.

Code: Select all

$ nconvert -resize longest 150 -o try.jpeg -out jpeg IMG_0132_2.jpeg > /dev/null
Conversion of IMG_0132_2.jpeg into try.jpeg OK

Re: -o creates wrong file extension

Posted: Wed Jan 05, 2022 1:57 am
by midnightoil
Only problem remaining is that it doesn't handle case very well.

Output extension is always lower case (unless it is illegal)

Bad:

Code: Select all

nconvert -resize longest 150 -o thumbs/IMG_0009.JPG  IMG_0009.JPG
Conversion of IMG_0009.JPG into thumbs/IMG_0009.jpg OK

nconvert -resize longest 150 -o IMG_0006.JPEG -out JPEG IMG_0006.JPEG
Bad output format 'JPEG'
Good:

Code: Select all

nconvert -resize longest 150 -o thumbs/IMG_0003.jpeg -out jpeg IMG_0003.jpeg
Conversion of /IMG_0003.jpeg into thumbs/IMG_0003.jpeg OK