Announcement

Collapse
No announcement yet.

How to define all text overly attributes by a command line

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

    How to define all text overly attributes by a command line

    Hello,

    I ask here quite the same question than previously (without answer) but not using the same way to formulate.

    I want to write command lines with parameters to define the treatment of a file which is add text overlay on a defined (selection) zone on a jpg file.

    To do this, for the moment I could use easily the menu command "add text overlay into selection"

    Now I have to do it on 70 000 files.
    So I am looking for the way to use "command line" to define a "batch treatment".

    How all the parameters of the function can be introduced into a batch treatment ?

    Thank's if you have an answer.

    Best regards

    Trebly

    nota : A batch job could :

    - apply same parameters to various files.
    - apply various parameters to various groups of files.

    #2
    Originally posted by trebly View Post
    Hello,
    I want to write command lines with parameters to define the treatment of a file which is add text overlay on a defined (selection) zone on a jpg file.
    To do this, for the moment I could use easily the menu command "add text overlay into selection"
    Now I have to do it on 70 000 files.
    So I am looking for the way to use "command line" to define a "batch treatment".
    How all the parameters of the function can be introduced into a batch treatment ?
    Trebly

    nota : A batch job could :
    - apply same parameters to various files.
    - apply various parameters to various groups of files.
    70000 is a lot of files. Whatever method you use it is not going to be a quick job.

    The fastest technique is the Batch process that is part of Irfanview. With that you can add text with the same parameters (same text, same position, etc.) to any number of files. When you need to change the parameters for another batch of files, though, you would need to re-open the batch dialog and change the text parameters and file list.
    You could probably automate this process using a program like AutoIt. You could prepare in advance lists of the files to be processed with the same parameters and save them as text files to be quickly loaded at the appropriate times.

    Alternatively you can launch Irfanview using the /AdvancedBatch option from a command line in a Batch or other script but that only allows you to process one file at a time, so processing 70000 would be very slow. You can edit the i_view32.ini file from a script file as I discussed in this thread when you need to change parameters. The parameters to change are in the [Batch text] section of the ini.

    If you look towards the end of that thread you can also read the posts by Impdf about the Imdib program that his company have developed. That would allow another alternative where you open each file and copy it to the clipboard using Irfanview with the /clipcopy option and then use Imdib to add text and save it. That might be faster if you need to change text parameters for each file.

    Comment


      #3
      Hello,
      thanks for your answer,

      As I have studied, a little, the problem and made some test :
      - It is sure that it is a long job for a computer but it is not a real problem for the man if the automation is possible.
      - I have looked at the batch with advanced options for "add overlay text" etc. with use and save of INI file(s). This is the interesting solution for a group of files of same type with the same parameters (imagine as example pages of documents and EXIF data's, it runs...), if the job is more varied and the number more important the alternative solution of line command with /AdvancedBatch seems to be the lonely possibility that I discuss after
      You wrote : a command line in a Batch or other script but that only allows you to process one file at a time
      I have then some questions :

      1- Why such a command lines like following could not function :
      - i_view32.exe c:\*.jpg /advancedbatch /ini="Folder" /convert=c:\temp\*.jpg or
      - i_view32.exe /filelist=txtfile /advancedbatch /ini="Folder" /convert=c:\temp\* (here the problem is the /filelist definition used for "/convert/*" files - *=eachfile of filelist)

      2- The previous command line uses the ini="Folder" option which makes to apply the same parameters to all files.
      With this solution if you need various text but with the same shape of which components can be defined into EXIF metadata there no problem.
      For this I need (I have not yet found) a soft (library VBA for example) to manage (write : title, author, copyright - with an encrypted code, comments particularly), do you know one well done.

      3- If the position of the text (selection position) , color of text changes for example then, as these data are defined into the INI file, the INI file must be changed.
      There are two solutions, in my opinion :
      a - use a soft, for example written with VBA (visual basic application) using a list of files defined in an Excel sheet with the associated parameters, script which will write the INI file, and after run the command line, this for each file (the interest of Excel or OpenOffice is to easily define the parameters for the treatment of the files).
      b - use a new feature (or yet existing but not documented) of i_view32, just an enhancement, which is that the /ini="folder" command line parameter could accept either a directory name (actually) or a full file name with a shape like ../i_wiew32-*.ini
      then a line command of a system batch (windows cmd file) can run any option with pre-written ini files.

      I have first made this answer, now I am going look in detail to Imdib and the Impdf posts.

      Thanks
      Best regards

      trebly
      Last edited by trebly; 08.10.2010, 07:48 PM. Reason: some miswriting

      Comment


        #4
        There is no documentation for the Irfanview command line options other than the examples given in the Help file. So you will probably need to try out for yourself what you propose to use.

        1: Yes you can certainly use /ini="folder" option with /advancedbatch to load different ini files but remember that every file must be named i_view32.ini, so each one must be in a different folder. A lot of work to create all those different i_view32.ini files I would think.
        I do not know about using /filelist=txtfile with /advancedbatch. I have never tried it. I would expect that adding /convert=C:\temp\*.* would result in the output files being written in the C:\temp folder with their original file names and type and /convert=C:\temp\*.jpg would give the original name but converted to jpg if not already in that format.

        2: I find this question a little confusing. Do you want to write encrypted text into EXIF tags? There is nothing in Irfanview to help you there AFAIK.

        3: a - I too would probably use Excel to prepare and sort the data for whatever program script is going to control the batch process. I have never used VBA to control Irfanview directly from Excel so i do not know what is possible.
        I would probably export the Excel file as csv and use that as data source for a VBS script. I know how to use a Shell object to run programs and a FileSystem object to read and write text files in that program, but best to use whatever you are familiar with. I think I would create a completely new Irfanview ini file to work with by opening the program and just running a batch operation with text added. The script file would first open that ini file and save it as a long text string. A subroutine would then be called every time the text parameters needed to be changed to replace entries as required in a copy of the string and save it as the new ini file. Then it would run Irfanview with the command line options to either process a single file or a folder full if you can get that filelist option to work.
        b - post it as a request by all means. It would certainly be useful to be able to use the form " /ini= ...\anything.ini "

        Afterthought: You can save and load from the advanced batch dialog small ini files just containing the [Batch] , [BatchText] and [Effects] sections under any name you choose. It would be useful if you could load those "mini-ini" files directly from a Command line as a standard option rather than having to use my VBS script.
        Last edited by Mij; 09.10.2010, 03:31 PM. Reason: Added the afterthought

        Comment

        Working...
        X