# How to save images as album arts according to audio filenames

**URL:** https://community.mp3tag.de/t/how-to-save-images-as-album-arts-according-to-audio-filenames/15707
**Category:** Support
**Created:** [May 3, 2014, 10:34am UTC](https://community.mp3tag.de/t/how-to-save-images-as-album-arts-according-to-audio-filenames/15707 "2014-05-03T10:34:05Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![RarLines](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@RarLines](https://community.mp3tag.de/u/RarLines)
#### Post date: [May 3, 2014, 10:34am UTC](https://community.mp3tag.de/t/how-to-save-images-as-album-arts-according-to-audio-filenames/15707/1 "2014-05-03T10:34:05Z")

</div>

Hi everyone! First post for me 🙂

After a downloading process (thanks to jdownloader) I've thousands files like so:

```
Queen - Love of My Life (256kbit).m4a
Queen - Love of My Life (BQ).jpg

Queen - Bicycle (128kbit).m4a
Queen - Bicycle (HQ).jpg

Gary Jules - Mad World (256kbit).m4a
Gary Jules - Mad World (BQ).jpg

...

```

How can we embed the images to their audio files as album arts? Files are not exactly same but alike.

---

<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: [May 3, 2014, 11:36am UTC](https://community.mp3tag.de/t/how-to-save-images-as-album-arts-according-to-audio-filenames/15707/2 "2014-05-03T11:36:23Z")

</div>

> [@RarLines](#):
>
> Queen - Bicycle (128kbit).m4a
> 
> ```
> Queen - Bicycle (HQ).jpg
> 
> ```
> 
> How can we embed the images to their audio files as album arts? Files are not exactly same but alike.

Apply the action "Import cover from file".  
This imports the cover art specified by the absolute or relative filename into the tag of the file.  
You can use placeholders like %artist% or %album%.  
You can use wildcards like ? or \*.

So it should be feasable to do ... having ...  
music file: Queen - Bicycle (128kbit).m4a  
image file: Queen - Bicycle (HQ).jpg  
... apply action ...  
"Import cover from file".  
Format string for image filename: **$regexp(%\_filename%,'(._$__','_****')**  
Import cover as: Front Cover

For image filename which is not exactly the same as the music filename, you may use a format string like ...

**$regexp(%\_filename%,'\W','?')'.jpg'** ==\> "Queen???Bicycle??128kbit?.jpg"

... this replaces all characters, which are not letters or numbers or underline character, with the ? wildcard.

**$regexp(%\_filename%,'\W+','\*')'.jpg'** ==\> "Queen\*Bicycle\*128kbit\*.jpg"

... this replaces all sequences of characters, which are not letters or numbers or underline character, with the \* wildcard.

**$regexp($regexp(%\_filename%,'\(.\*\)$','\*'),'\W+','\*')'.jpg'** ==\> "Queen\*Bicycle\*.jpg"

... this replaces all sequences of characters, which are not letters or numbers or underline character, with the \* wildcard, and replaces the trailing parenthetical expression with the \* wildcard.

DD.20140503.1538.CEST

---

<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: [May 3, 2014, 11:47am UTC](https://community.mp3tag.de/t/how-to-save-images-as-album-arts-according-to-audio-filenames/15707/3 "2014-05-03T11:47:39Z")

</div>

> [@RarLines](#):
>
> Hi everyone! First post for me 🙂
> 
> After a downloading process (thanks to jdownloader) I've thousands files...

If you have the files in separate folders (e.g. one per album including the audio- and the picture files) then you can use the \*.jpg mechanism that selects the first picture file from a folder to import as albumart.

---

<div class="post-metadata">

### Author: ![RarLines](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@RarLines](https://community.mp3tag.de/u/RarLines)
#### Post date: [May 3, 2014, 2:51pm UTC](https://community.mp3tag.de/t/how-to-save-images-as-album-arts-according-to-audio-filenames/15707/4 "2014-05-03T14:51:33Z")

</div>

> [@DetlevD](#):
>
> **$regexp($regexp(%\_filename%,'\(.\*\)$','\*'),'\W+','\*')'.jpg'** ==\> "Queen\*Bicycle\*.jpg"
> 
> ... this replaces all sequences of characters, which are not letters or numbers or underline character, with the \* wildcard, and removes the trailing parenthetical expression.

> [@](#):
>
> ... and removes the trailing parenthetical expression.

That's what I need !

It works like a charm ! 😃

I know some regex and your examples helped me understand quickly. Great thanks DetlevD!

---

<div class="post-metadata">

### Author: ![cdmcmillon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/cab0a1/32.png) [@cdmcmillon](https://community.mp3tag.de/u/cdmcmillon)
#### Post date: [May 28, 2015, 8:59pm UTC](https://community.mp3tag.de/t/how-to-save-images-as-album-arts-according-to-audio-filenames/15707/5 "2015-05-28T20:59:11Z")

</div>

> [@ohrenkino](#):
>
> If you have the files in separate folders (e.g. one per album including the audio- and the picture files) then you can use the \*.jpg mechanism that selects the first picture file from a folder to import as albumart.

I am sorry, very new to this, I still don't get this. This solution is exactly what I need to do. However, I still don't have the right syntax entered in the Import Cover Art from file action. My file location is K:\album\_art and the jpeg files are named "Artist - Title" my MP3 files are all "Artist - Title" as well, so they all should match up. Please help me with the exact syntax.

---

<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: [May 29, 2015, 4:11am UTC](https://community.mp3tag.de/t/how-to-save-images-as-album-arts-according-to-audio-filenames/15707/6 "2015-05-29T04:11:19Z")

</div>

> [@cdmcmillon](#):
>
> ... My file location is K:\album\_art and the jpeg files are named "Artist - Title" my MP3 files are all "Artist - Title" as well ...

The filename of the audio file is only of interest if you want to use that a source for the picture filename...

I assume that you have filled the tags so that the field %artist% and %title% contain data.

So, in the import cover from file dialogue enter the following as filename:  
K:\album\_art\%artist% - %title%.jpg

If you really only have the filename as data source, try this as filename for the covers:  
K:\album\_art\%\_filename%.jpg

---

<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:25pm UTC](https://community.mp3tag.de/t/how-to-save-images-as-album-arts-according-to-audio-filenames/15707/7 "2026-02-09T12:25:01Z")

</div>


