Announcement

Collapse
No announcement yet.

Help with batch convert and rename saving

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

    Help with batch convert and rename saving

    I am trying to batch convert and rename files, and keep the resulting file in the same directory as the first. How would I do this Here is my file structure:

    Music
    Artist 1
    Album 1
    Album 2
    Album 3
    Artist 2
    Album 1
    Artist 3
    Album 1
    Album 2

    Hopefully this makes sense. I have a file "cover.jpg" in each album folder. I am trying to create a 170x170 "coversmall" of each "cover" in each album folder. I would like the "coversmall" to be saved in the same folder as it's "cover". I do not see an option to keep the resulting file in it's original folder when adding all files. For example, if I select the music folder and tell IRFRAN to add all files, it will give me all the files I want to change. However, when I select "use current directory" for output, it will give me "music" as the directory to save in. How do I get the output files to remain in their original directory when adding subfolders?

    Thanks

    #2
    Sorry, there is a problem doing what you want.
    What you should be able to do is to use the name pattern $D$Nsmall$O and leave the Output directory box blank.
    That name pattern works fine to add text to a fullscreen image but there is a bug that prevents you using $D in a batch file name.
    Instead of inserting C: as the drive name the batch dialog inserts C_ and the file cannot then be saved.

    I remember that this bug was reported a long time ago but it is still present.

    Comment


      #3
      So you are saying it isn't possible to batch convert and rename files and have them save in multiple directories? Or, are you saying it will work if I leave the output directory blank? I haven't had a problem with naming in my tests, just save placement. Thanks for the reply.

      Comment


        #4
        I don't use this much, but I think you can do it by saving the converted files to a temporary folder, e.g. C:\TEMP\Music\ with the create subfolders in destination folder item checked.

        Then copy C:\TEMP\Music\ back over C:\My Document\Music\ or whatever.
        Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

        Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

        Comment


          #5
          OK, lets take this a step at a time.

          1. If you are just using Batch rename:
          The path and name given to the output file is whatever you put in "Output directory" added in front of what is generated by "Name pattern" and its options.
          What you want to do with the name is easy to achieve. Instead of using $F (file name and extension) in the Name pattern you can use $N (file name only) and $O (extension, including the .). So $Nsmall$O will generate the original file name and extension with "small" added to the end of the file name.
          Recreating the path is more difficult. You have only $D and $d for use in the name pattern. $d will reproduce the name of the final subfolder in the original path name. So if your file structure had a "Music\" folder with "Album1\ Album2\ and Album3\" subfolders you can put the path name C:\....\....\Music\ as "Output directory" and use $d in your "Name pattern" to add Album1\ Album2\ or Album3\ as appropriate.
          If, as I assume, you have folders called C:\ ....\....\Music\Artist1\Album1 then you cannot add both Artist1\ and Album1\ with a name pattern except by using $D which should generate the whole path C:\ ....\....\Music\Artist1\Album1 for you. Because of a bug though it doesn't. It actually generates C_\ ....\....\Music\Artist1\Album1 which cannot be saved and generates an error message. Problem! (By the way you cannot use "Replace C_ with C:" in the Name pattern options. It only works on the $F or $N part.)

          2. If you are using Batch convert and rename then you have another option, as Bhikkhu says:
          In the Convert options you can check "Create subfolders in destination folder". You then only need to put C:\ in "Output folder" and the remainder of the path will be created for you. The "Name pattern" will then be just $Nsmall
          The extension will however be whatever you set the "Output format" to be and the file will be converted to that format whatever it was originally. Putting $O in the name pattern has no effect. So you cannot use this method for renaming a variety of file types.

          That is the present situation with Irfanview. I suspect that the bug I mentioned was either forgotten or was never passed on to Irfan.

          Comment


            #6
            Originally posted by Mij View Post
            OK, lets take this a step at a time.



            2. If you are using Batch convert and rename then you have another option, as Bhikkhu says:
            In the Convert options you can check "Create subfolders in destination folder". You then only need to put C:\ in "Output folder" and the remainder of the path will be created for you. The "Name pattern" will then be just $Nsmall
            The extension will however be whatever you set the "Output format" to be and the file will be converted to that format whatever it was originally. Putting $O in the name pattern has no effect. So you cannot use this method for renaming a variety of file types.

            That is the present situation with Irfanview. I suspect that the bug I mentioned was either forgotten or was never passed on to Irfan.
            I think I have the naming right. At least it has worked in the tests. The problem is that I haven't figured out a way for the program to save the converted and renamed files in all of the different subfolders. It wants to save them in the parent folder and then their are overwriting problems. All of my files are named cover.jpg. I have 2000 albums or so. So, I want 2000 coversmall.jpg's in the matching folders. I don't think the program can do this. I think I will try making a test folder and use that as the output folder with the program creating the subfolders. Hopefully it can create the artist folder with the album folders under those and save there. Then I will try to merge the test folders with the real folders and copy only the coversmall. Will this work? It seems this is what Bhikkhu Pesala is suggesting.

            Comment


              #7
              Using "Create subfolders in destination folder" appears to work OK for me. In fact I see that you can leave the "Output directory" box completely blank. All the renamed files went back in the same folder as their original.

              In case I misunderstood what you are trying to do I have attached screenshots of what I did.
              Attached Files

              Comment


                #8
                It looks like this is what I want to do. Your pictures appear to be in different folders like mine. I will try this and report back. Thanks!

                Comment

                Working...
                X