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:
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.

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?

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

(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

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:
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)

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

Related to the content of your file at 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

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 ...
Images.zip (95.74MB)
[outdated link removed]

DD.20111211.2035.CET
Edit.20130122.1120.CET

GetImages.cmd.txt (14.6 KB)

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.

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

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.

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'

DD.20111211.2045.CET

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.