# 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:** 1
**Showing post:** 2

<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

---

_[View the full topic](https://community.mp3tag.de/t/how-to-save-images-as-album-arts-according-to-audio-filenames/15707)._
