Announcement

Collapse
No announcement yet.

Convert multiple TIFF files to a single multi-page file

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

    Convert multiple TIFF files to a single multi-page file

    Is there a way to convert a whole folder of single-page TIFF files to one multi-page TIFF file from the command line?

    I'm trying to set-up a batch file to do this.

    Wildcards are not allowed in the "/multitif=" function

    Thanks for any help with this one.

    #2
    It is pretty straightforward to do from the GUI. Is there any special reason you want to use a command line?
    Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    Comment


      #3
      I'm trying to have this done automatically without having to open the program.

      Comment


        #4
        How do I do it in the GUI?

        Comment


          #5
          From the View menu, select Multipage images, create multipage tiff.

          Add images by browsing and selecting multiple images.

          Set compression if you want, and save the file.
          Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

          Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

          Comment


            #6
            That's exactly what I want to do but I want to be able to do it without opening the program and clicking on everything.

            Is there no way to do the same function from the command prompt?

            Comment


              #7
              Hi shoehn,

              Here is a copy/paste from IrfanView's help about command line:

              Example for /multitif:
              Syntax: /multitif=(tifname,file1,...,fileN)
              First file is the name of the result TIF file.
              i_view32.exe /multitif=(c:\test.tif,c:\test1.bmp,c:\dummy.jpg)
              Create multipage TIF ('c:\test.tif') from 2 other images.
              Does this help?

              Laurent
              Before you post ... fill in your OS and IV version in your profile.

              Comment


                #8
                I've looked at that but it doesn't allow wildcards so creating a single multi-page tiff of say 50 single-page tiff's in a folder would be difficult.
                Thanks for the input though... I'm still working on a solution.

                Comment


                  #9
                  Okay, I figured a way to do it using the /append option in a batch file:

                  for %%a in (*.*) do "c:\program files\irfanview\i_view32.exe" %%a /append=temp\final.tif /killmesoftly /silent

                  Thanks for the help.

                  Comment


                    #10
                    shoehn,

                    I had to combine hundreds of single page PCX files into multi-page files and had similar difficulties getting it to work from the cmdline as documented. Laurent's post of the instructions is correct:

                    i_view32.exe /multitif=(c:\test.tif,c:\test1.bmp,c:\dummy.jpg)

                    This syntax is correct, however it will fail if any of the file names in parentheses have quotations (which of course are required with filespecs contain spaces. That is, the above syntax will ONLY work if the filenames do not contain spaces (and therefore do not require quoting).

                    I see this as a bug since, in general, quoting filenames is the normal method of dealing with filenames containing spaces from the cmdline.

                    Note that you can (and must) quote the path to IV.exe if not submitting the cmdline from IV's directory (if it contains spaces), for example:

                    "c:\Program Files\IrfanView\i_view32.exe /multitif=(c:\test.tif,c:\test1.bmp,c:\dummy.jpg)

                    shoehn, your /append solution using a the DOS 'for' command works, but requires working knowledge of this command. I wrote myself a README file in the folder I typically use when setting up these conversions to remind me of this bug so I don't have to go through the frustration of figuring out why it doesn't work as expected when I need to do this again. My README is below (I will add your for ... /append method for future reference).

                    Chris

                    ----------------------
                    README.txt re: /multitif
                    ----------------------

                    Syntax for combining single-page files into a multi-page TIFF:

                    "EXEPATH" /tifc=4 /multitif=(OUTFILE,File1,File2,...FileN) /killmesoftly

                    where
                    EXEPATH = path to IrfanView
                    OUTFILE = filespec of TIF file to create
                    File1... = comma-separated list of source files to be combined

                    NOTE: The /killmesoftly option terminates IrfanView after the conversion, otherwise it stays open. This option is NOT needed fot the /convert option, just the /multitif option.

                    Notice there are NO QUOTES in the multitif part of the cmdline. This is VERY IMPORTANT when using /multitif=() to combine files, DO NOT USE QUOTES FOR ANY OF THE FILENAMES IN THE PARENTHESES (output file or input files). This is a bug in IrfanView, it will not work if there are quotes inside the parentheses. Therefore, if either the OUTFLIE or any input files have spaces in the pathspecs, when using the /multitif option, they MUST to be copied to a path without spaces OR IT WILL FAIL. Alternatively, you can change to the folder containing the input files before calling IrfanView (assuming the base filenames do not have spaces), in which case the filenames do not need folders/paths.

                    Thus, if the source files are in "My Documents\Images", then:

                    cd "c:\My documents\images"
                    "EXEPATH" /tifc=4 /multitif=(NewTif.tif,Page1.pcx,Page2.pcx) /killmesoftly

                    Comment


                      #11
                      Chris/all,

                      The problem I was having was:
                      1. The documents were being scanned into the computer (and named by the scanner (e.g. _0720091400_005.tif) so the filenames would change each scan/day.
                      2. I have around 60-70 docs to convert into one multipage doc.

                      I didn't see any way to automate this task without opening the program and manually selecting the files and merging them into one multipage TIFF.

                      The batch file seem to work fine but it would be nice if the /multitif command allowed filelists to merge.

                      I also ran into the problem with quotes around path\filename and used the same solution to change to the folder containing the files.

                      Thanks for your input and if anyone has an /cleaner/easier (free) solution I'd love to hear it.

                      Comment


                        #12
                        Hi,

                        That woks fine...

                        Is there a command line option to set the compression rate, too?

                        Regards,

                        Roland

                        Comment


                          #13
                          Hi Roland,

                          welcome here

                          It depends on your used output format. For jpg use that command (after the source file

                          Code:
                          /jpgq=75
                          For example:

                          Code:
                          i_view32.exe c:\text.jpg /jpgq=75 c:\testkonvertiert.jpg
                          compression rate is 75 ...

                          steve

                          Comment


                            #14
                            Hi Chris,

                            Instead of using quotes for the names containing space, one can use the 8.3 names of the files and directories. To know them, use the command
                            Code:
                            dir /N /X
                            Most of the time, it is the six first letters (without space if any) followed by ~1.
                            For example
                            c:\Documents and Settings\Laurent\Mes Documents\image test.jpg
                            is the same as
                            C:\DOCUME~1\LAURENT\MESDOC~1\IMAGET~1.JPG

                            Maybe this is better than renaming directories or moving files.

                            Laurent
                            Before you post ... fill in your OS and IV version in your profile.

                            Comment


                              #15
                              Originally posted by shoehn View Post
                              Okay, I figured a way to do it using the /append option in a batch file:

                              for %%a in (*.*) do "c:\program files\irfanview\i_view32.exe" %%a /append=temp\final.tif /killmesoftly /silent

                              Thanks for the help.
                              The above procedure worked great, you rock!
                              I've been able to create a ~500-800 page tif file with this batch string which is more than the GUI allows you to do.

                              I did run into a problem trying to create really huge multipage tifs(~2000 pages) though. The resulting tif file has a file size that makes sense for the number of images however IV only shows it to have 5/5 pages which aren't even valid. I think there might be an issue with the amount of time needed to open/close IV when the file gets huge but the batch file keeps slaming it. Is there a way to add a delay into that FOR loop? sorry I'm not much of a programer.

                              Comment

                              Working...
                              X