Announcement

Collapse
No announcement yet.

Batch settings that can be stored/loaded via template?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Requested Batch settings that can be stored/loaded via template?

    First post here...however...

    I've been using IV for maybe 3+ yrs, (and LOVE it and recommend it to others), and the thing that I use it for most commonly at the moment is to convert output BMP files from scanner to JPGs...so the input files are always in same input folder...fine...BUT:

    Sometimes I've been doing other work so navigating to my scanner output folder is a nuisance as it's about 5 levels down (my preference for organization)...and...I almost always create two different output copies using totally different properties (size/output folder/etc) from one input...so I'd REALLY like:

    1) The ability to save all current settings from a batch run (input folder, output folder, options, advanced opts. etc) as a "template"
    2) The matching ability to load these templates into a batch run (using GUI) so I can thus more easily change the settings for each pass, and simply have to select the desired files in folder and start run.

    If this ability exists now, I must not have noticed it...
    As it is now, I have to change output folder (and remember which is which!), change options for Quality, change advanced opts for Resize, and a couple of others each time, which is getting to be a real PITA...sorry!
    Last edited by j_c_hallgren; 18.08.2007, 04:14 PM.

    #2
    It sounds like you use the GUI for batching image conversions.

    If you instead us the DOS batching - with the IView command line interface, you can set up a file that will do what you want per a set of operations.
    then, make similar bit different command line parameter changes (what input folder, what output folder, what conversion format type, rotation, output size, etc.) per batch file.

    Just a suggestion.
    I wish to die peacefully in my sleep, like my grandfather.
    Not like those passengers, in his car, when he drove over that cliff.

    Comment


      #3
      Originally posted by j_c_hallgren (from another thread) View Post
      Maybe this BAT file idea would help satisfy my request for a "template"?
      But it appears there are some parameters that can't be presently set via command line...
      What sort of parameters are you wanting to use that you can't be set via command line?
      I wish to die peacefully in my sleep, like my grandfather.
      Not like those passengers, in his car, when he drove over that cliff.

      Comment


        #4
        Good question. Since the command line options always can be the subject of improvement, I like to know too.

        DOS batchfiles indeed have a great potential for such processes. One can even use one .BAT-file for different purposes because one can type options after the command, which are transferred as a variable in (IV's) command line.
        Meaning the string of 'output folder' is replaced by '%1'. Then, batchfile called 'convert.bat', one could type :
        "convert group1" to save the result of the action in subdir group1, or type :
        "convert group2" to get the result of exactly the same procedure into subdir group2.

        A DOS batchfile also can contain a list of subsequent IV commandlines in one.
        0.6180339887
        Rest In Peace, Sam!

        Comment


          #5
          Now that I can reply to this (had a forum access issue that blocked me today!), I can give a clue as to what I don't see as possible via command line:
          1) The ability to do a convert and rename in one pass, using a pattern that includes a specific literal followed by a "##" with a starting value -or- using the "replace text with" options...I don't do this every time, but use it quite often...
          2) The advanced options to do "overwrite output" and "save files with original date/time"

          If this is possible now, I don't see it in Help...I could have missed it, but I think I read it quite completely...

          Addendum: Given my needs, I would think that having a way to save/load all options used for a batch run via GUI would be easier to work with for novice or less 'techy' users also...

          I would use the Templates option in "Find Files" in the XYplorer file manager product as a sample of a dialog that might be suitable for this purpose. I use XYplorer daily and participate heavily in that forum....for reference, see http://www.XYplorer.com
          Last edited by j_c_hallgren; 21.08.2007, 03:24 AM.

          Comment


            #6
            I thought of another improvement of the command-line :
            Resize not only with pixel-values, but also 'half', or at least percentage.
            0.6180339887
            Rest In Peace, Sam!

            Comment


              #7
              Originally posted by Sam_Zen View Post
              Resize not only with pixel-values, but also 'half', or at least percentage.
              I had thought that existing resize parameters did not allow a percentage, but the Help file examples show one using a "p" suffix (150p) which is not described (to my knowledge) anywhere else...I have not tried this, but presume it would work...

              The 'half' option is not provided for, in any case, it would appear.

              Comment


                #8
                Great tip.
                For this issue, I created a special directory (..Irfan View/batch) for experimenting with a BAT file containing a IV command-line
                (plus a line with 'pause' to have a grip on the process to see if all goes well).
                Having two JPG bitmaps in that folder I tried this commandline, after some mistakes with the expression, :
                "..\i_view32.exe *.jpg /invert /resize=(50p,50p) /resample /convert=*.bmp"

                And it works. The result was 2 inverted BMP files half the size of the original.
                I will add this option at least to my personal version of 'i_options.txt'.
                0.6180339887
                Rest In Peace, Sam!

                Comment


                  #9
                  Well, it's now been close to TWO years since my original thread posting and thus far, I still don't see any evidence that any progress has been made on this topic and I'm still having to deal with the problems of keeping track of what options I've set and output folders, etc...so I'll restart using same thread, ok?

                  My issue still remains the same in that I want to use the GUI to select all desired options, save that as a template or similar, and then use the GUI to select desired files (and SAVE that list!)...when batch is done, I can then load the 2nd template and hopefully load saved file list and do 2nd pass...

                  You don't know how much easier this would make my usage of IV!

                  Comment


                    #10
                    Hello j_c_hallgren,

                    I'm sorry you've had to wait two years, but the capability actually has been there already. You just need to manage different INIs. And they need to be mostly complete, because the settings are distributed beyond the batch section.

                    What you need to do is:
                    1. Start with your actual program INI, and make sure all your settings that are non-specific are set.
                    2. Make some folders in your installation folder, or some folder with write permission; one for each batch job you like to do, each with an easy ID name.
                    3. Place a copy of your program INI in each folder you made.
                    4. Make copies of your shortcut to IrfanView (if you have one, otherwise make one), and place them someplace convenient.
                    5. Give each one an easy ID name that match the folders you made.
                    6. Edit the target path of each shortcut, and add at the end the /ini=folder switch. You might have something like "C:\Program Files\IrfanView\i_view32.exe" /ini="D:\INIs\Small".
                    7. You should have several shortcuts that will each be able to start IrfanView differently now. Start each one and modify the settings that you want to be different. This also makes changing settings easier, if the need arises.
                    8. When you are ready, you can begin each shortcut, load your file list in the batch dialog, and perform each unique conversion.
                    9. You might give each shortcut a hotkey to start easier.


                    You can make a file list using the Thumbnails window or the Slideshow dialog. You can start batch conversion from Thumbnails, or start IrfanView with a txt file from the command line.

                    There are more ways to access custom settings:

                    • One way is to copy IrfanView's EXE (and any additional files you need), and run different folders of it with their own INIs inside them.
                    • You can also do the same by dropping in an EXE in one of your INI folders you made.
                    • Or type your custom command line in the Run box instead of using shortcuts.
                    • Make a batch file that allows you to drag-and-drop an INI folder on it to start Irfanview.


                    Speaking of which, a multi-run batch file works well for your purpose (in fact, better now since the command line accepts file lists as input!). IrfanView actually does allow overwrites via the command line, it just doesn't prevent them. But, like you say, many features are unsupported like special renaming and original date/time. So, the GUI may be the only way to go, even if does require more labor.

                    Comment


                      #11
                      Originally posted by Skippybox View Post
                      I'm sorry you've had to wait two years, but the capability actually has been there already. You just need to manage different INIs. And they need to be mostly complete, because the settings are distributed beyond the batch section.
                      See...that's my problem...that's the 1990's way of doing it...I'm sorry (and I may seem stubborn..sorry ) but I just don't want to deal with INI's (or batch files) when many other app's can easily handle this type of ability via GUI within one execution of the app! Now how the app does it may differ, but they typically offer some sort of a template or settings file that one can select while you have the app already started via the normal/typical process, ok? No need to have numerous shortcuts splattered here and there that need to be maintained or located...I would just pick the desired template from within the batch GUI (like "Load Template") as one presently does a "Load TXT" is how I see it implemented, or when I have the batch settings the way I want, I'd do a "Save Template" from same dialog.

                      Any option that I can set via GUI from Batch dialog panels and Options within that should be stored in this template so that one can easily swap processing modes with just a minimal nbr of mouse clicks.
                      This also thus means that any/all OTHER settings not related to the batch dialog would still be stored in the common INI and thus if changed would apply without having to update numerous INI's.
                      You can make a file list using the Thumbnails window or the Slideshow dialog. You can start batch conversion from Thumbnails, or start IrfanView with a txt file from the command line.
                      Again, that's making it TOO difficult IMO...I just want to: start IV, use B to get into batch mode, select the files I want and get the Input list just like I desire, and then do a "Save TXT" so that for the next pass, I can use the existing "Load TXT" to reload the input...see how simple that would make it? I have NO reason to use the Thumbnails or Slideshow when I doing these conversion as the input is most often a small set of files that are within the same folder each time (output folder from scanner) but they are mixed in with other files in that folder that aren't part of that particular process so I can't do a "Select All" either.

                      I just don't get why with all the development that has occurred in 2+ yrs why such a simple ability to save a TXT file of the batch input couldn't have been added when there has been some (what at least appears to be) really complicated features added...
                      Last edited by j_c_hallgren; 03.07.2009, 06:57 AM.

                      Comment


                        #12
                        Well if you have another app that will do it, then use it.

                        The thing is, the INI is your template; it's where all the settings are stored. So, it should not be that hard to use it. With my method, you don't even have to think about the INIs and loading them, they just sit in their folders and do the work for you. If you wanted, you could even skip copying INIs and let IrfanView make them for you (but that's more work IMO). All you do is use the shortcuts like a bunch of little IrfanView programs, all independently working differently. They are easy to set and start, so why is that so difficult? If it is indeed a template, are you really going to change it or use it for other things anyway?

                        All you do is click a shortcut, press B, load the txt file, run the batch, close, and repeat. The shortcuts don't need to be splattered, they can all be in one easy to access location. Certainly this can't we any worse than what you are doing now to deal with your problem. If you don't like clicking shortcuts or manual control, that's where a batch file comes in handy. It could load each command for you as you finish each conversion. All you need to do is press ESC to start the next one.

                        The problem is you want to just load a template, but you can't, because IrfanView's settings are not isolated to just batch. You're taking format save settings, text settings, filter settings, etc. that are used throughout the program. These can't be duplicated in the INI just for batch conversion. The INI stores each setting once, and therefore must be in effect for the whole program, not just batch. If a template was loaded that did "everything", it would overwrite your normal INI (which actually happens to some extent already). How would you use the rest of the program?

                        If the INI really did have separate settings just for batch, that would be kind of confusing to users who expect settings to be consistent across the program. And if instead, they were just moved to batch, that would be not very easy to find. Duplicating settings wouldn't take much space, but add undue complexity.

                        Maybe it is 1990's, but that's kind of what sets IrfanView apart from the rest. I don't see Irfan completely overhauling something already invested in.

                        Saving a txt file in batch does make perfect sense, and frankly, I don't get this either why it is missing.
                        Last edited by Skippybox; 07.07.2009, 12:41 AM.

                        Comment


                          #13
                          Originally posted by Skippybox View Post
                          Well if you have another app that will do it, then use it.
                          I've been quite busy for last week so just catching up with this thread now...and no, I don't have another image edit app that will do what I want, but was saying that I have various other app's for functions like file manager have templates that work just fine and still use INI's as main setting storage.

                          The thing is, the INI is your template; it's where all the settings are stored. So, it should not be that hard to use it. With my method, you don't even have to think about the INIs and loading them, they just sit in their folders and do the work for you. If you wanted, you could even skip copying INIs and let IrfanView make them for you (but that's more work IMO). All you do is use the shortcuts like a bunch of little IrfanView programs, all independently working differently. They are easy to set and start, so why is that so difficult?
                          Why so difficult? Because...there is no logical reason whatsoever that I should need to start up an app, do a function, close the app, and repeat that process for other functions! I should be able to do it with the app open in one single execution...like...When I have Excel open, I can run various macros without closing the app...When I use a media player, I don't have to restart the app to load a new playlist or have to have shortcuts to each playlist...etc, etc...

                          There should be one and only one shortcut to Irfanview.exe on my Start menu (and same for Desktop and/or Quick Launch if user desires those methods) to make application mgmt simple...that's why I have ALL my shortcuts stored in "All Users" so that both my logins have same setup...I can't stand having more than one path to an EXE file on my system so having various shortcuts isn't an option.

                          Taking your approach to the next level would mean that I shouldn't have an issue with shutting down Windows between each usage of IV...it's just as silly...sorry!
                          The problem is you want to just load a template, but you can't, because IrfanView's settings are not isolated to just batch. You're taking format save settings, text settings, filter settings, etc. that are used throughout the program. These can't be duplicated in the INI just for batch conversion. The INI stores each setting once, and therefore must be in effect for the whole program, not just batch. If a template was loaded that did "everything", it would overwrite your normal INI (which actually happens to some extent already). How would you use the rest of the program?
                          How would I use the rest of the program? Exactly the same way that I do now...I know that these settings are shared...and that's not a problem because loading a "template' is simply a way of altering a whole bunch of settings at one time instead of one at a time manually via GUI, ok? Obviously any settings that are changed via a "template" would be in effect until changed by another template load or manually...I don't see why you think this would be an issue...it's in fact a way to solve a problem, not create one.
                          If the INI really did have separate settings just for batch, that would be kind of confusing to users who expect settings to be consistent across the program. And if instead, they were just moved to batch, that would be not very easy to find. Duplicating settings wouldn't take much space, but add undue complexity.
                          I never said it should have separate settings for batch...I did say that those settings modifiable via GUI's from batch could be a subset that would be stored in a template as alternatives or overrides...so that the routine that normally saves the entire INI would just save selected entries as a template...nothing complex about that...it's quite simple actually.

                          And the load template would just apply any/all settings within it to the currently running IV...any setting not within the template would remain as is.
                          Maybe it is 1990's, but that's kind of what sets IrfanView apart from the rest. I don't see Irfan completely overhauling something already invested in.
                          I'm not saying that using different shortcuts to execute various versions of IV is totally wrong for those users who want that awkward way of doing it....just that it makes no sense when other app's can have similar abilities (templates) as option as well without any major effort...look at Search Templates in http://www.xyplorer.com, for example.
                          Saving a txt file in batch does make perfect sense, and frankly, I don't get this either why it is missing.
                          Good! At least we agree on this!
                          Last edited by j_c_hallgren; 12.07.2009, 04:51 AM.

                          Comment


                            #14
                            Once upon a time I started writing a script to process an incremental ini file for Irfanview. The idea was that you would prepare a file with just the ini lines that you wanted to change and drop it onto a shortcut that would then change just those lines of the IrfanView ini file that you wanted.
                            I think such an incremental ini file is the sort of Template you might need for this.

                            I wrote a VB script (called ini_set.vbs) to replace a single line but I never got around to completing the project.
                            FWIW I have attached it below. Someone else might feel inspired to finish it, or one day I might even do so myself.

                            Code:
                            ' Call from command line. Example:   Cscript [path]ini_set.vbs "[path]i_view32.ini" "CanvL=80"
                            Const ForReading = 1
                            Const ForWriting = 2
                            strFileName = Wscript.Arguments(0)				'Path and name of ini file to search
                            strNewText = Wscript.Arguments(1)				'New ini line in form Parameter=value
                            Dim strOldText						'Old ini line in form Parameter=value
                            Dim strText						'String for holding the whole ini file,
                            Dim FoundAt, OldLength					'Position and length of Old ini line
                            
                            Set objFSO = CreateObject("Scripting.FileSystemObject")		'Create an object to hold the file
                            Set objFile = objFSO.OpenTextFile(strFileName, ForReading)		'Open ini file for reading
                            strText = objFile.ReadAll					'Read whole file into strText
                            objFile.Close
                            
                            strOldText= Left(strNewText, Instr(strNewText, "="))		'Strip value leaving Parameter=
                            FoundAt = Instr(1,strText, strOldText)				'Find Parameter
                            
                            Select Case FoundAt
                             Case 0 wscript.Echo "Text " & strOldText & " not found in file. (Note; Case sensitive)"	'Report; Parameter not present
                             Case 1 wscript.Echo "Error: No = sign found in " & strNewText		'strOldText is still empty
                             Case Else
                               OldLength = Instr(FoundAt, strText, chr(13)) -FoundAt			'Find length to end of line
                               If OldLength<1 then OldLength=Len(strText)-FoundAt+1			'No end of line. Assume last line in file
                               strOldText=Mid(strText, FoundAt, OldLength)				'Extract the line to be replaced
                               strText = Replace(strText, strOldText, strNewText)			'Replace old with new
                               wscript.Echo strOldText &" was replaced by "& strNewText			'Report; Parameter replaced
                               Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)			'Open ini file for writing
                               objFile.WriteLine strText						'Replace whole file with modified strText
                            End Select
                            Last edited by Mij; 13.07.2009, 03:22 PM. Reason: Small error in code

                            Comment

                            Working...
                            X