Exclusion parameter usage

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

Moderators: XnTriq, helmut, xnview

tamle
Posts: 11
Joined: Mon Nov 13, 2017 10:55 am

Exclusion parameter usage

Post by tamle »

I am setting up an image folder that will be frequently added. Those images must be optimized for storage. I am running a bat file that will do them all with Nconvert. However, I needed to exclude the optimized/processed images from the processing. As for now, I am using the functionality of cmd.exe in window to exclude those. I renamed processed file with "_c_" at the end (delete the original). I looped through each files and run the nconvert command for the files that don't have "_c_". I read the help file but do not see a way to exclude certain files. It would act like a filter that include certain files and exclude certain files in processing. Is there a way to do it with Nconvert natively?
User avatar
xnview
Author of XnView
Posts: 44922
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Exclusion parameter usage

Post by xnview »

there is no way, but i think that you need to filter the names in the .bat before to start NConvert
Pierre.
tamle
Posts: 11
Joined: Mon Nov 13, 2017 10:55 am

Re: Exclusion parameter usage

Post by tamle »

xnview wrote: Mon Oct 22, 2018 7:34 am there is no way, but i think that you need to filter the names in the .bat before to start NConvert
Is it possible to include it in the future? Because for inclusion, I can do mass operation for the whole folder like

Code: Select all

nconvert -out jpeg -ratio -rtype lanczos -rflag decr -rflag orient -resize 1400 1400 -D *.png
But because of exclusion, I have to loop through the name of each and every single file and run the command for that file only. Nconvert already go through the files' name for filtering. I would imagine the parameter to exclude would not be very radical restructuring. May be something like this

Code: Select all

-excl *.txt -excl *cc.jpg
cday
XnThusiast
Posts: 4186
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Exclusion parameter usage

Post by cday »

Having previously marked processed files, you could if necessary insert a line in your batch file that moves those files to a temporary directory before processing the new files, and then a line that moves them back afterwards? Should be quick and just adds two lines of code.

Alternatively, the problem wouldn't arise if processed files could have a different extension.
tamle
Posts: 11
Joined: Mon Nov 13, 2017 10:55 am

Re: Exclusion parameter usage

Post by tamle »

cday wrote: Mon Oct 22, 2018 8:46 am Having previously marked processed files, you could if necessary insert a line in your batch file that moves those files to a temporary directory before processing the new files, and then a line that moves them back afterwards? Should be quick and just adds two lines of code.
I think moving files would create more risk than ignoring the files. That problem could multiply if large files (in size and number) are involved. I don't know the operating system and cmd.exe well enough to assert the degree of those problem. But like I said, Nconvert already go through the files' name to determine which one should be processed. Stopping certain files from processing should not be a unreasonably large effort, IMHO.
cday wrote: Mon Oct 22, 2018 8:46 am Alternatively, the problem wouldn't arise if processed files could have a different extension.
I actually just run for *.* because 2 reasons. 1) The images I receives are from 40+ different people with different phone, settings, camera, platform... I don't really know which file type I will receive. I only know that their files is usually too large for my processes. 2)Nconvert will ignore the files it cannot process so it will not be too much problem.
cday
XnThusiast
Posts: 4186
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Exclusion parameter usage

Post by cday »

tamle wrote: Mon Oct 22, 2018 9:19 am
cday wrote: Mon Oct 22, 2018 8:46 am Having previously marked processed files, you could if necessary insert a line in your batch file that moves those files to a temporary directory before processing the new files, and then a line that moves them back afterwards? Should be quick and just adds two lines of code.
I think moving files would create more risk than ignoring the files. That problem could multiply if large files (in size and number) are involved. I don't know the operating system and cmd.exe well enough to assert the degree of those problem.
I don't know cmd.exe that well either, but if you need a workaround that you can use now, I think it should work. The processed files to be moved will presumably have manageable file sizes.

If files that have been processed are marked with a _ suffix then the files to be moved could be selected using *_.* .

You could also easily, if necessary, create the temporary directory and later delete it (with care) using cmd.exe .

But like I said, NConvert already go through the files' name to determine which one should be processed. Stopping certain files from processing should not be a unreasonably large effort, IMHO.
Yes, if Pierre can implement it and you are able to wait.
tamle
Posts: 11
Joined: Mon Nov 13, 2017 10:55 am

Re: Exclusion parameter usage

Post by tamle »

Yes, if Pierre can implement it and you are able to wait.
Sure. I am thinking this could be useful for XNconvert as well. One text box for exclusion parameter could help user don't have to tick check boxes one by one.