Page 1 of 3

[request] batch-convert options

Posted: Fri Oct 07, 2011 11:01 pm
by gendalf
I need an option in batch-convert, to convert current image only if new file size is less than old file size

and option to save options of batchconvert to use later multiple times same options

Re: [request] batch-convert options

Posted: Mon Oct 10, 2011 8:35 am
by xnview
gendalf wrote:I need an option in batch-convert, to convert current image only if new file size is less than old file size
Ok
and option to save options of batchconvert to use later multiple times same options
you have script

Re: [request] batch-convert options

Posted: Fri Oct 21, 2011 2:14 am
by gendalf
you have script
i save options (only .bat available), but the next time: i try to open saved .bat but it shows only .xbs files
???

Re: [request] batch-convert options

Posted: Mon Oct 24, 2011 12:16 pm
by xnview
gendalf wrote:
you have script
i save options (only .bat available), but the next time: i try to open saved .bat but it shows only .xbs files
???
Sorry but i don't understand, if you save script as xbs, you are able to load it later...

Re: [request] batch-convert options

Posted: Wed Nov 02, 2011 9:39 pm
by gendalf
I haven't noticed that the save button is only active when entering characters into the field. -_- therefore i saved it using the export button

Re: [request] batch-convert options

Posted: Mon Aug 20, 2012 1:13 pm
by gendalf
will you implement this 'condition on convert' stuff? :(
like when i use batch convert - check each file - if new file size smaller than previous file size then convert this file and check next, else check next file

Re: [request] batch-convert options

Posted: Mon Sep 21, 2015 2:01 pm
by jupi
Hi, i would appreciate this function too
...some checkbox for "do it only if result image is smaller than original"

(I didn't find option for that even in when i use scripts)

Re: [request] batch-convert options

Posted: Tue Feb 25, 2020 2:29 pm
by gendalf
on top of that idea would be nice to have an option to chose the lowest size from the selected preset formats & their settings, so for example:
batch convert images inside selected folders into one of webp, jpg, gif using set settings, chosing whichever is the smallest per file, delete originals to bin

Re: [request] batch-convert options

Posted: Thu Feb 27, 2020 11:05 am
by xnview
gendalf wrote: Mon Aug 20, 2012 1:13 pm will you implement this 'condition on convert' stuff? :(
like when i use batch convert - check each file - if new file size smaller than previous file size then convert this file and check next, else check next file
so like this topic

Re: [request] batch-convert options

Posted: Mon Mar 16, 2020 7:59 pm
by gendalf
xnview, I haven't found anything described in this thread in NConvert either

Re: [request] batch-convert options

Posted: Mon Mar 16, 2020 8:22 pm
by cday
gendalf wrote: Mon Mar 16, 2020 7:59 pm xnview, I haven't found anything described in this thread in NConvert either
The conversion option recently added to NConvert compares the file size of the input file with a specified numeric value:

Code: Select all

-greater_than type value  : Process only if arg is less than value: Overwrite existing file
-less_than type value     : Process only if arg is less than value
 type : height width filesize
Note that the filesize is specified in bytes.

Hopefully Pierre will soon add an option to test against the file size of the input file.

Re: [request] batch-convert options

Posted: Fri Mar 27, 2020 10:11 am
by gendalf
cday, the whole request is about new file size vs old file size, not a specified value, also ideally not command line/script :?
(skip converting any images where the encoded version would be larger than the original)

the only application I've found so far that is able to do this (almost) exactly as I want is Android Studio, but it has a few issues:
it only does this for webp ( https://developer.android.com/studio/write/convert-webp );
you have to select folders with an image at the same level, otherwise the context option doesn't appear for just folders selected;
it takes a lot of extra space to run the option as it is not doing it image by image but rather the entire batch at once; (and the program itself is 2.2gb)
still room for improvement like for example options to ignore extensions.
Also it doesn't seem to work with larger folder structures/numbers of files, idk if it just doesn't like a variety of symbols/languages or what..
it removes exif/data.

here is its log:
366 files were converted
66.1 MB saved
1090 files were skipped because there was no net space savings

Re: [request] batch-convert options

Posted: Mon Feb 14, 2022 8:02 am
by xnview
gendalf wrote: Fri Mar 27, 2020 10:11 am cday, the whole request is about new file size vs old file size, not a specified value, also ideally not command line/script :?
(skip converting any images where the encoded version would be larger than the original)
So a 'skip files where the encoded result is larger than original' only when you the output folder is 'source', right?

Re: [request] batch-convert options

Posted: Fri Feb 24, 2023 11:44 am
by gendalf
@xnview,
0: add folder (with subfolders) to batch convert. (ideally with a filter list to only select certain filetypes within)
1: encode source file with desired settings
2: compare file sizes of encoded and source
3.1: encoded filesize < source filesize:
place source to bin if it's larger and place encoded file in source folder
3.2: encoded filesize >= source filesize:
do nothing or increase counter (e.g. to display how many files weren't converted due to this condition in results log and list them, maybe)

Re: [request] batch-convert options

Posted: Sun Feb 26, 2023 1:51 pm
by xnview
ok, i'll add a setting