Import cover-jpg-files into mp3-files in 'batch-mode'

Hi all,

I know mp3tag can (almost) do everything - how about this ?

Johann Strauss wrote 479 pieces of music, I have all as mp3-filess, some multiple by different artists, names as follows:

For all I have jpg-files with an explanation of the opus with the name
Strauss-J2_op354.jpg (substring of filename) which should appear for each artist's version.

With 1by1 this one jpg-file is shown in all different mp3-files (file-name starting with identical Strauss-J2_op354).

I know how to integrate them into the mp3-files manually with mp3tag - but approx. 500 times ...

Who can help ? What is the more efficient, elegant and less boring way ?

Thanks and regards, Bernd.

I am not sure wheter I understand the problem in full.
So I start like this: mp3tag has several ways to import bitmaps as cover.
e.g. select all the files that shoudl get the same cover, press Alt-T and then the "NEW" button right beside the (empty) cover and select the bitmap file. The bitmap will be stored in each selected file.

Or: you may import the bitmap with an action "Import album art" and either specify a fixed name like
or let mp3tag take the first bitmap file it finds using
or construct a filename from the tags in the respective audio file, e.g.

Does any of these methods meet your requirements?


thanks for your ideas which I hope will pave the way to the destination. The point is:

I do NOT want

one jpg for all mp3 or
one specified for an artist for all mp3

My jpg-files all have a name that is a substring of those mp3-files (in the beginning of the mp3-filename) into which they should be integrated. 1by1 does understand this - if a file-import algorithm would understand this as well, all would be fine. For illustration:

1by1 would show the cover-file


for all the following mp3-files:


How to bring this into a mp3tag-command ? That is the question.

Please find the directory-list of jpg and mp3 here

(please note: I do not yet have alljpg for all mp3 - I make screenshots out of pdf-files, those are 52 in total:

That should clarify it - I want to bring all the covers into the appropriate mp3-files.

I think this must work - I just do not know how ;-(

Thanks again and regards, Bernd

OK, this is not quite as straightforward but could lead to a course of actions that lets the machine do most of the work:

The combination of filenames looks like this:

So, I would do a Convert Filename > tag with the mask
which would fill the userdefined tag COVERNAME.
This tag should contain "Strauss-J2_op002" for the example.
Then I would execute an action "Import album cover" with the contents
This should import the file Strauss-J2_op002.jpg as album cover.
As all the other files have similar structures before the "18" the converter should work for all of them.
One more thing: afterwards the userdefined field is still in the files but not needed any more. you may delete it - easiest done with the extended tags dialogue (alt-T)

You can also do it in one step with the Import cover action and this string:

Related to the content of your file at ...
Because the filename structure is the same on both filetypes, mp3 and jpg, at least for the leading two items, which are separated by the underline character, so they share the same substring, we can use this substring of the mp3 filename to build the jpg filename just on the fly, while executing the action "Import cover from file".
Action: Import cover from file
Formatstring for filename: $regexp(%filename%,'^(.+?.+?)_.*$','$1')'.jpg'


Dear all,

thanks a lot for your contributions which remind me to former Unix-times. I will try to understand and apply your recommendations - otherwise I really would not have known what to do this evening -)

I will be back - either to report 'all worked well' or to ask for further clarification.

Thanks again, regards, Bernd.

Note regarding retrieving of images ...

If you have installed the graphic software suit "ImageMagick", then you may run this command file ...
GetImages.cmd.txt (14.6 KB)[Right click on the link and save as ...]
[Remove the file extension ".txt" before use!]

... to get this result ... (95.74MB)
[outdated link removed]


GetImages.cmd.txt (14.6 KB)


your suggestion is easiest for me to understand, nevertheless I have not fully understood yet.

Recently I ask how to bring the name of a subdir into the tag album of the files in this subdir - I was told to use


and this worked perfectly, over 40.000 files with one click. Great.

Now I used %covername%_18%dummy% as suggested in a test suite for three mp3-files and two jpg-files. It looks quite promising with the result

tag from 3 out of 3 filenames extracted and saved - but the graphic had not been stored.

What am I missing ? I think it's very close to the goal.

Can you reconstruct what happens here ? Should a '' be added ? I tried already following the example that works so well with the subdirectories...

Sorry to bother you, but I would be more than happy if this could work ...

Thanks and regards, Bernd.

I do know (from my job) image-magicks more by name than by experience andI do not have it on my PC. Just to confirm:

All 'cover'-files that should be integrated into the mp3-file are available in the subdirectory, together with the mp3-files, check here:


...and so on, sometimes one artist, sometimes more mp3-files of different artists which should only one identical cover-jpg-file.


There must be a way to make this, I am sure - I just don't know how.

Sorry, so long, Bernd.

Above proposal in post #5 should work.
Import cover-jpg-files into mp3-files in 'batch-mode'
Above proposal in post #6 should work.
Import cover-jpg-files into mp3-files in 'batch-mode'


Dear Detlev,

I don't know how and why, but your suggested string worked and mp3tag did exadctly what I wanted - THANK YOU VERY MUCH.

I will first write it down and later try to understand - at least it worked perfectly.

Best regards, Bernd.