Page 1 of 2

file extension error?

Posted: Thu Dec 09, 2021 8:01 pm
by tomv
Hi there,
I'm on windows 10, nconvert v7.95

I have a folder with this 2 files:

IMG_4954.JPG
IMG_4954.JPG_original

then exec this command:
.\NConvert\nconvert -o "..\CARPETA_DE_PROCES\%%" -keep_icc -ratio -rtype hanning -rflag decr -resize shortest 1500 -rotate 90 -D -overwrite "..\CARPETA_DE_PROCES\*.jpg " "..\CARPETA_DE_PROCES\*.jpeg "

the problem is that the image "IMG_4954.JPG_original" is unexpectedly processed too. Nconvert is taking the file type not from file extension?

thanks.
best regards

Re: file extension error?

Posted: Thu Dec 09, 2021 8:33 pm
by cday
Two thoughts, possibly neither very helpful:

1. With your input term "..\CARPETA_DE_PROCES\*.jpeg " rather than "... *.jpg" I'm surprised that either file is processed!

2. Acceptance of "IMG_4954.JPG_original" as an input filename is possibly not a design case, not anticipated that syntax would be used.

Re: file extension error?

Posted: Fri Dec 10, 2021 9:56 am
by tomv
Hi, thanks for your response. For me seems that nconvert looks the file type inside file instead of on the file extension.

Re: file extension error?

Posted: Fri Dec 10, 2021 10:29 am
by cday
tomv wrote: Fri Dec 10, 2021 9:56 am Hi, thanks for your response. For me seems that nconvert looks the file type inside file instead of on the file extension.
Pierre?

Re: file extension error?

Posted: Mon Dec 13, 2021 9:47 am
by xnview
and if you use

Code: Select all

.\NConvert\nconvert -o "..\CARPETA_DE_PROCES\%%" -keep_icc -ratio -rtype hanning -rflag decr -resize shortest 1500 -rotate 90 -D -overwrite ..\CARPETA_DE_PROCES\*.jpg ..\CARPETA_DE_PROCES\*.jpeg
without "?

Re: file extension error?

Posted: Tue Dec 28, 2021 7:31 pm
by tomv
Sorry, I thought I had activated the email notifications and until today I have not seen the message.

Yes, removing "the same thing happens

Re: file extension error?

Posted: Tue Dec 28, 2021 7:50 pm
by cday
tomv wrote: Tue Dec 28, 2021 7:31 pm Yes, removing "the same thing happens
Not solved?
tomv wrote: Fri Dec 10, 2021 9:56 am For me seems that nconvert looks the file type inside file instead of on the file extension.
I have tested *.jpg and *.jpeg, and source files are filtered correctly according to their extension...

Re: file extension error?

Posted: Tue Dec 28, 2021 8:01 pm
by tomv
hi,

.jpg and .jpg files are correctly processed, the point is that in the directory I hava files with file format "name.JPG_original" that is suposed not to be processed

Re: file extension error?

Posted: Tue Dec 28, 2021 8:05 pm
by cday
tomv wrote: Tue Dec 28, 2021 8:01 pm .jpg and .jpg files are correctly processed, the point is that in the directory I hava files with file format "name.JPG_original" that is supposed not to be processed
Agreed that it wouldn't be expected to be processed...

cday wrote: Thu Dec 09, 2021 8:33 pm Acceptance of "IMG_4954.JPG_original" as an input filename is possibly not a design case, not anticipated that syntax would be used?
Seems reasonable, you could possibly try other ways of disabling reading of unwanted files, maybe .xxx for example...

Re: file extension error?

Posted: Tue Dec 28, 2021 8:20 pm
by tomv
only Pierre knows for sure, but it seems that the program checks if a file is of the jpg type by reading some attribute and not the extension.

Looking for another way to not process these files? yes, for example I can call the program iteratively for each specific file. But for me it is a thing to fix. Imagine that you have files that you want to keep intact and the program processes them when it was not supposed to ...

Re: file extension error?

Posted: Tue Dec 28, 2021 8:27 pm
by cday
tomv wrote: Tue Dec 28, 2021 8:20 pm it seems that the program checks if a file is of the jpg type by reading some attribute and not the extension.
Doesn't the fact that the code correctly distinguishes .jpg and .jpeg show that is not the case?

If you wish to use your existing code you might, as you know how you are operating, change to the extension to .png for example, if you use an extension that isn't recognised the files won't be processed but an error will be reported in the terminal output for each file, may or may not be an issue.

Something like that might provide a workaround pending a possible fix by Pierre, if needed.

tomv wrote: Tue Dec 28, 2021 8:20 pm only Pierre knows for sure...
That should be the case if he considers the issue...

Re: file extension error?

Posted: Wed Dec 29, 2021 10:12 am
by xnview
i can't reproduce, only .jpg/.jpeg are processed... you use terminal to execute this command?

Re: file extension error?

Posted: Wed Dec 29, 2021 7:45 pm
by tomv
Hi, I use this instructions in a cmd batch file

Re: file extension error?

Posted: Wed Dec 29, 2021 8:14 pm
by cday
Looking at your code, two observations:

Code: Select all

-o "..\CARPETA_DE_PROCES\%%"
In the above term you haven't included a file extension, which I think should be included, although it may not always actually be necessary.

Code: Select all

"..\CARPETA_DE_PROCES\*.jpg " "..\CARPETA_DE_PROCES\*.jpeg "
And in the above terms there is a space after the extension before the quote ", which probably isn't actually an issue.

You might test at least the first suggestion in this unexplained situation, although even so Pierre was unable to reproduce the result you are obtaining.

Re: file extension error?

Posted: Sun Jan 02, 2022 6:12 pm
by tomv
Hi there and happy new year!

Unfortunately the two issues discussed in the previous message are not the cause.
I don't understand how Pierre can't reproduce the error. I attach a small video where you can see what happens. Look at the size of the images and that the .JPG_original file is also processed.