rename *.jpg cover files to folder.jpg within directory


#1

Hi there everyone...

I've been looking to convert my cover art files (various-filenames.JPG) to folder.jpg as an action within MP3Tag.

All my mp3 files are sorted: SHARE//artist/album/tracknumber - trackname.mp3

Within the ALBUM directory sits a xyz.jpg file as cover. However, the filenames vary.

I would like to automatically rename all jpg files within directories (incl. subdirectories) to folder.jpg

Has anyone got an idea how to go about it intelligently?

Thanks for the efford to help me out :sunglasses:

s0liver


#2
  1. Step:
    Go to: Tools > Options > Tags. In the field "Restrict incoming files to:" add .jpg (or/and .gif , *.bmp , whatever you need). When you now load a directory into Mp3tag, jpg files are also listed.

  2. Step:
    Use the Filter (F3) with
    %_extension% IS jpg
    or
    %_extension% MATCHES (jpg|jpeg|png|gif|bmp)

  3. Step:
    Use the Tag - Filename Converter with simply:
    folder

@Detlev:
quicker :wink:


Hilfe bei Umbenennung Mp3+Cover Datei muss neu werden
#3

How do you define 'intelligent'?
I would simply do it manually using the TotalCommander displaying the complete foldertree in "Zweigansicht' with Filter '*.jpg'. Then pressing [Ctrl+A] [Ctrl+M], then putting in the filename 'folder', then [Alt+S]. Ready.

For repeated mass renaming of picture files I would recommend to use IrfanView.
It has a good working batch section, can also read in a text list file.

Or do it with a commandline batch file.

Search the forum, I assume there are examples how it can be done what you want to do.
For example see post #2 in this thread for an interesting approach of mis-using Mp3tag.

DD.20110405.1824.CEST


#4

This looks like a task for the operating system.
You could proceed as follwos:
open a command shell (cmd.exe)
navigate to the top-most folder.
type in the command
dir /b /s *.jpg > pictures.txt
This will create a text file that has a list of jpg in all subdirectories.
An entry may look like this:
c:\music\band\a-ha\eastsun.jpg
c:\music\band\abba\arrival.jpg

open the text file with an editor that has the ability to search for the (in word this is ^p)
replace the with " folder.jpgren "
the two entries from the example will look like this:
c:\music\band\a-ha\eastsun.jpg folder.jpg
ren c:\music\band\abba\arrival.jpg folder.jpg
ren

delete the superfluous "ren "after the last entry and insert one in the first line.
save the text file with the extension cmd (not txt)
in the command shell type in
pictures.cmd
and all the addressed jpgs will be renamed.


#5

Hallo altogether...

thanks for all the suggestions. It seems that this requirement is not a normal "feature" of MP3Tag :smiley:

Maybe I should suggest it as a new feature...

Also many thanks to pone. This is what I meant with "intelligent" solution... not having to install another tool since MP3Tag is so versatile, it surely should be able to rename a few jpg files somehow...

With pone's solution you don't even have to use the filter function in step 2 since jpg files don't have ID3 tags and so they will always appear at the bottom or the top of the list (if sorted by album or any other non-filename tag).

Has anyone here compiled a few best-practice Actions? I looked through the FAQs and the forum but found nothing...

Regards s0liver and thanks to all of you again for all the help.


#6

You forgot the 4. Step.
Set the Mp3tag options back to former state.

Hmm ... and TotalCommander give me the chance to set all files to the same date and set the read only attribute and ...

DD:20110406.1925.CEST


#7

I have new solution for this old problem. It is similar to ohrenkino's solution above, but it works only in the the directory of the current file and you don't have to work with text editors once you have set up the tool.
You have to create a .bat file and a Mp3tag Tool. To create a bat file, create a .txt file and rename it to .bat

bat file:
Name: C:\Users<username>\AppData\Roaming\Mp3tag\rename picture to folder.bat
Code:

cd %1
 ren *front*.jpg folder.jpg
 ren *cover*.jpg folder.jpg
 ren *.jpg folder.jpg
 ren *front*.png folder.png
 ren *cover*.png folder.png
 ren *.png folder.png
 ren *front*.gif folder.gif
 ren *cover*.gif folder.gif
 ren *.gif folder.gif
 ren *front*.bmp folder.bmp
 ren *cover*.bmp folder.bmp
 ren *.bmp folder.bmp

Mp3tag tool:
Name: Rename picture to Folder
Path: C:\Users<username>\AppData\Roaming\Mp3tag\rename picture to folder.bat
Parameter: "%_folderpath%"

The bat file will only rename one picture of every filetype. It looks first for a file with "front" in the name, than for a file with "cover". If both not found, the alphabetically first file will be renamed to folder.

I have included several filetypes to have one tool for all files. But you can also split this into different tools or use only jpg files. No filetype will be changed and only files with the specified extentions (.jpg / .png / .gif / .bmp) will be renamed.

I'm new to the cmd operations. So please correct me if I made a mistake somewhere. But it seems to work perfectly from a few test I have done.


#8
QUOTE (pone @ Feb 6 2012, 17:20) <{POST_SNAPBACK}>
...
cd %1
 ren *front*.jpg folder.jpg
 ren *cover*.jpg folder.jpg
 ren *.jpg folder.jpg
 ren *front*.png folder.png
 ren *cover*.png folder.png
 ren *.png folder.png
 ren *front*.gif folder.gif
 ren *cover*.gif folder.gif
 ren *.gif folder.gif
 ren *front*.bmp folder.bmp
 ren *cover*.bmp folder.bmp
 ren *.bmp folder.bmp<!--QuoteEnd--></div><!--QuoteEEnd-->

If you keep the extension ".jpg" you can simply replace it by the asterisk. This would save you the bother of thinking of all the possible file type extensions:
So you could simply use

cd %1
 ren *front*.* folder.*
 ren *cover*.* folder.*
 ren *.jpg folder.*

Actually, I am not quite sure whether really all bitmaps are allowed. I always thought that only jpg and png were accepted as covers. But I could be wrong.
(The gifs at least because there was a licence fee connected to this format. So in many cases this was only taken as format if compuserve was the originator).


#9
QUOTE (ohrenkino @ Feb 6 2012, 18:10) <{POST_SNAPBACK}>
If you keep the extension ".jpg" you can simply replace it by the asterisk. This would save you the bother of thinking of all the possible file type extensions:

So you could simply use

cd %1
  ren *front*.* folder.*
  ren *cover*.* folder.*
  ren *.jpg folder.*

Actually, I am not quite sure whether really all bitmaps are allowed. I always thought that only jpg and png were accepted as covers. But I could be wrong.
(The gifs at least because there was a licence fee connected to this format. So in many cases this was only taken as format if compuserve was the originator).

Replacing the extention with an asterisk would rename mp3 files with "front" or "cover" in the filename. This would not be a wanted behaviour.

Allowed and accepted by whom or what? I guess I don't have many bmp files as cover pictures, but sometimes there are scans in this format. I included folder.jpg and folder.gif in the search pattern for foobar, and it has no problem with bmp files. Mp3tag doesn't display them in the preview window, but that doesn't matter for the bat file.


#10

I transfomed the tool into an export and that works without problem. With a fixed path where to export the .bat file and %_folderpath% being written into the export file for CMD. After exporting, I click "Show exported file" ("Soll die Exportdatei jetzt angezeigt werden?"), and the bat file runs. Nice.

But: the goal of that was to make an action, which peroforms the export, wich creates & performs the .bat file. (Because action are quicker to perform via the menu bar, which is not possible for exports and tools.)

And there is the problem: If a export is performed vie an action, Mp3tag doesn't ask i the file show be displayed. So the bat file doesn't run automatically. Can this be change?


#11

Hmm ... you can create the command file in a special folder, just created for this purpose.
Use a tool or service to watch this folder.
When the watcher has detected any change in this folder or has detected an incoming file, then run the command file.
I am not aware of any free and good working tool out there.
This would need some time to discover a useful one.

Hmm ... maybe somewhat like this ...
waitdirchg.exe
http://ss64.net/westlake/nt/

DD.20120207.1215.CET


#12

Thanks. I guess that would work. But I don't want to have another tool which is always running in the background.
It's not that big deal. I will use the bat file as a tool within Mp3tag. Transforming it to an action would have made it a bit easier to use for my personal workflow. But I can live with the tool. Maybe Florian picks up my proposal in that other topic of building tools & export into the menu bar...


#13

Here is a small demo package how a simple folder watcher could work ...
20120207.DD.WDC.Demo.1.0.zip ( 78.95K ) Number of downloads: 2
DD.20120207.1702.CET

Here is a small demo package how a simple folder watcher could work ...
... now including sleep.exe and waituntil.exe, when needed.

20120207.DD.WDC.Demo.1.01.zip (121 KB)
DD.20120208.0825.CET

20120207.DD.WDC.Demo.1.01.zip (121 KB)


#14

Thanks Detlev for caring. But really don't want another tool in the background. Running the .bat via Mp3tag's tools works fine.