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

**URL:** https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800
**Category:** Support
**Created:** [December 11, 2011, 11:14am UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800 "2011-12-11T11:14:07Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![vorticity](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/7ab992/32.png) [@vorticity](https://community.mp3tag.de/u/vorticity)
#### Post date: [December 11, 2011, 11:14am UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/1 "2011-12-11T11:14:07Z")

</div>

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:  
Strauss-J2\_op354\_Wiener\_Blut\_artist\_1.mp3  
Strauss-J2\_op354\_Wiener\_Blut\_artist\_2.mp3  
Strauss-J2\_op354\_Wiener\_Blut\_artist\_3.mp3

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.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 11, 2011, 11:54am UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/2 "2011-12-11T11:54:27Z")

</div>

> [@vorticity](#):
>
> ...With 1by1 this one jpg-file is shown in all different mp3-files (file-name starting with identical Strauss-J2\_op354).

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  
folder.jpg  
or let mp3tag take the first bitmap file it finds using  
\*.jpg  
or construct a filename from the tags in the respective audio file, e.g.  
Strauss-J2\_op354\_%artist%

Does any of these methods meet your requirements?

---

<div class="post-metadata">

### Author: ![vorticity](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/7ab992/32.png) [@vorticity](https://community.mp3tag.de/u/vorticity)
#### Post date: [December 11, 2011, 1:22pm UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/3 "2011-12-11T13:22:58Z")

</div>

Hi,

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

Strauss\_op001.jpg

for all the following mp3-files:

Strauss-op001\_artist1.mp3  
Strauss-op001\_artist2.mp3  
Strauss-op001\_artist3.mp3

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

Please find the directory-list of jpg and mp3 here

[http://www.vorticity.de/mp3/strauss.txt](http://www.vorticity.de/mp3/strauss.txt)

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

[http://www.naxos.com/johannstraussedition](http://www.naxos.com/johannstraussedition)

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

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 11, 2011, 2:08pm UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/4 "2011-12-11T14:08:17Z")

</div>

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:  
Strauss-J2\_op002.jpg  
Strauss-J2\_op002\_1844\_Debut-Quadrille\_Walter\_SVSPO\_0104.mp3

So, I would do a Convert Filename \> tag with the mask  
%covername%\_18%dummy%  
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  
%covername%.jpg  
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.  
Edit:  
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)

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [December 11, 2011, 2:34pm UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/5 "2011-12-11T14:34:47Z")

</div>

You can also do it in one step with the Import cover action and this string:  
_$regexp(%filename%,'^(.+?op\d+).+',$1).jpg_

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [December 11, 2011, 2:39pm UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/6 "2011-12-11T14:39:30Z")

</div>

> [@vorticity](#):
>
> ... 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. ...  
> Strauss\_op001.jpg  
> for all the following mp3-files:  
> Strauss-op001\_artist1.mp3  
> Strauss-op001\_artist2.mp3  
> Strauss-op001\_artist3.mp3  
> How to bring this into a mp3tag-command ? That is the question. ...

_Related to the content of your file at [http://www.vorticity.de/mp3/strauss.txt](http://www.vorticity.de/mp3/strauss.txt) ..._  
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'**

DD.20111211.1642.CET

---

<div class="post-metadata">

### Author: ![vorticity](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/7ab992/32.png) [@vorticity](https://community.mp3tag.de/u/vorticity)
#### Post date: [December 11, 2011, 3:20pm UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/7 "2011-12-11T15:20:00Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [December 11, 2011, 5:40pm UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/8 "2011-12-11T17:40:26Z")

</div>

> [@vorticity](#):
>
> Dear all, thanks a lot for your contributions which remind me to former Unix-times. ...

Note regarding retrieving of images ...

If you have installed the graphic software suit "ImageMagick", then you may run this command file ...  
[GetImages.cmd.txt](https://community.mp3tag.de/uploads/default/original/2X/d/d73d6a50843f7da46dc8b69fd5fea11a38a06e2c.txt) (14.6 KB)[Right click on the link and save as ...]  
[Remove the file extension ".txt" before use!]

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

DD.20111211.2035.CET  
Edit.20130122.1120.CET

[GetImages.cmd.txt](https://community.mp3tag.de/uploads/default/original/2X/d/d73d6a50843f7da46dc8b69fd5fea11a38a06e2c.txt) (14.6 KB)

---

<div class="post-metadata">

### Author: ![vorticity](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/7ab992/32.png) [@vorticity](https://community.mp3tag.de/u/vorticity)
#### Post date: [December 11, 2011, 6:08pm UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/9 "2011-12-11T18:08:24Z")

</div>

Hi,

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

%album%\%dummy%

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.

> [@ohrenkino](#):
>
> 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:  
> Strauss-J2\_op002.jpg  
> Strauss-J2\_op002\_1844\_Debut-Quadrille\_Walter\_SVSPO\_0104.mp3
> 
> So, I would do a Convert Filename \> tag with the mask  
> %covername%\_18%dummy%  
> 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  
> %covername%.jpg  
> 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.  
> Edit:  
> 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)

---

<div class="post-metadata">

### Author: ![vorticity](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/7ab992/32.png) [@vorticity](https://community.mp3tag.de/u/vorticity)
#### Post date: [December 11, 2011, 6:30pm UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/10 "2011-12-11T18:30:39Z")

</div>

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:

[http://www.vorticity.de/mp3/strauss.txt](http://www.vorticity.de/mp3/strauss.txt)

Strauss-J2\_op001.jpg  
Strauss-J2\_op001\_title\_artist.jpg  
Strauss-J2\_op002.jpg  
Strauss-J2\_op002\_title\_artist\_1.jpg  
Strauss-J2\_op002\_title\_artist\_2.jpg

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

Strauss-J2\_op478.jpg  
Strauss-J2\_op478\_title\_artist\_1.jpg  
Strauss-J2\_op478\_title\_artist\_2.jpg  
Strauss-J2\_op478\_title\_artist\_3.jpg  
Strauss-J2\_op479\_title\_artist.jpg  
Strauss-J2\_op479.jpg

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

Sorry, so long, Bernd.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [December 11, 2011, 6:45pm UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/11 "2011-12-11T18:45:19Z")

</div>

> [@vorticity](#):
>
> ... All 'cover'-files that should be integrated into the mp3-file are available in the subdirectory, together with the mp3-files ... 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'](https://community.mp3tag.de/t/12800/1)  
Above proposal in post #6 should work.  
[Import cover-jpg-files into mp3-files in 'batch-mode'](https://community.mp3tag.de/t/12800/1)

DD.20111211.2045.CET

---

<div class="post-metadata">

### Author: ![vorticity](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/7ab992/32.png) [@vorticity](https://community.mp3tag.de/u/vorticity)
#### Post date: [December 11, 2011, 7:25pm UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/12 "2011-12-11T19:25:37Z")

</div>

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.

> [@DetlevD](#):
>
> _Related to the content of your file at [http://www.vorticity.de/mp3/strauss.txt](http://www.vorticity.de/mp3/strauss.txt) ..._  
> 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'**
> 
> DD.20111211.1642.CET

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:23pm UTC](https://community.mp3tag.de/t/import-cover-jpg-files-into-mp3-files-in-batch-mode/12800/13 "2026-02-09T12:23:30Z")

</div>


