Problem with a *.pgm image

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

Moderators: XnTriq, helmut, xnview

herb
Posts: 273
Joined: Sat Jul 18, 2009 3:19 pm

Problem with a *.pgm image

Post by herb »

Hello Pierre,

On my Windows 10 system I work with Nconvert version 7.136 to convert images to *.jpg images.

Using only Ascii characters inside the filename I have seen the following problem with *pgm images:
I use the following command

Code: Select all

nconvert.exe -half_res -ignore_errors -thumb 1920 1920 -overwrite -out jpeg -o OUTPUTFILENAME-without-extension SOURCEFILE
In case of SOURCEFILE is a *.pgm image (or maybe another filetype) the outputfile is created without file-extension ".jpg".

Best regards
herb
User avatar
xnview
Author of XnView
Posts: 44583
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Problem with a *.pgm image

Post by xnview »

i can't reproduce, i've tried

Code: Select all

nconvert -out jpeg -o c:\output\test file.pgm
Pierre.
herb
Posts: 273
Joined: Sat Jul 18, 2009 3:19 pm

Re: Problem with a *.pgm image

Post by herb »

Hello Pierre,

thanks for your investigations.
I have to say sorry, because I did a big mistake.

The problem does not typically occur with *.pgm images.

Further tests showed that it occurs with all files that contain a dot "." in the filename: e.g. test.ascii.pgm

Code: Select all

nconvert.exe -half_res -ignore_errors -thumb 1920 1920 -overwrite -out jpeg -o test.ascii test.ascii.pgm
nconvert.exe -half_res -ignore_errors -thumb 1920 1920 -overwrite -out jpeg -o test.x test.x.psd
Both commands create output-files without extension.jpg

Best regards
herb
User avatar
xnview
Author of XnView
Posts: 44583
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Problem with a *.pgm image

Post by xnview »

ok, i understand now. The problem when using -o is: do you want to have test.ascii as output filename or test.ascii.jpg, i can't know
Pierre.
herb
Posts: 273
Joined: Sat Jul 18, 2009 3:19 pm

Re: Problem with a *.pgm image

Post by herb »

Hello Pierre,

I think that I now understand the logic used by NConvert:
  • -out defines the type of image to be generated
  • -o defines the filename
In case of the filename does not contain a dot - NConvert adds an extension which depends on filetype -out
In case of the filename does contain a dot - NConvert handles it as a filename with extension

When I am right, nothing has to be changed.

Best regards
herb