Import Cover from JPG OR PNG file


#1

Hi,
I have many files without cover, I wanted to batch "import cover" with action groups.
My files are :
Audio1.mp3
Audio1.png
Audio2.mp3
Audio2.jpg

I wanted to import PNG or JPG. I did a batch but there's too many errors.
I tried many way but nothing's really serious.
If you had a solution...

Thanks !

Thants !!


#2

Did you know that the "Import covers" action allows wildcards?
So you could enter as
format string: %_filename%.*
to cater for jpg and png


#3

Thank you to help me again :wink:
It doesn't work for PNG cover :
Import cover from file "%filename%.*" (Front Cover): Cannot read cover art from \?\W:_TEST\Audio1.mp3.


#4

I cannot say anything about whether the filename of the audio file actually matches the cover file.
But after the first run, you can filter for files that have not got an embedded cover with
%_covers% MISSING
and you then try something else which leads to more hits, e.g. *.png or *.jpg


#5

Audio contains no covers.
I try with *.png and after *.jpg but there's too many errors.
I'm searchin how to make a script (with Action Groups) to ADD cover on files, for all my files (in the same folder).
But it's a little hard for me, I'm a begginer in MP3Tag. :wink:

May be something like :
Loop with :

  1. if Audio1.png exist ==> Import Audio1.png -- if Audio1.png doesn't exist ==> No import
  2. if Audio1.jpg exist ==> Import Audio1.jpg -- if Audio1.jpg doesn't exist ==> No import
    EndLoop.

#6

Just an idea.

The errorstring you posted does indicate that you tried to load a cover from an mp3 file.
And it surely won't embed a file being of type mp3 as a picture.
I just tried by moving away my picture from a folder with audio files and the errorstring ended up like this:
......\folder.jpg
since I defined to load 'folder.jpg'
Looks to me as if you used a wildcard to cover jpg & png and then came across a track where the filename had no identically named jpg or png file besides.
Might be a typo, accidently 2 spaces inbetween or whatsoever.


#7

It's a good way and I did a test, but I used '%_filename%' (without .ext), cover is add but:
-If '.PNG' dosen't exists, '.JPG' is add = OK
-If '.JPG' dosen't exists, '.PNG' is add = OK
The probem :
Errors after add PNG or JPG. It's not a big problem but ot's not clean. :wink:

------------- Error result -------------
Import cover from file "$if2(%_filename%.png,%filename%.png)" (Front Cover): File \?\W:_TEST 2\Audio1.png cannot be accessed.
Import cover from file "$if2(%_filename%.jpg,%filename%.jpg)" (Front Cover): File \?\W:_TEST 2\Audio2.jpg cannot be accessed.
------------- Error result -------------

I use this script :
---------------- CUT HERE ----------------
[#0]
T=12
1=$if2(%_filename%.jpg,%_filename%.jpg)
2=1
3=3

[#1]
T=12
1=$if2(%_filename%.png,%_filename%.png)
2=1
3=3
---------------- CUT HERE ----------------

Thanks for your help, it's really appreciate.


#8

Sorry, your actions to not make sense as MP3tag does not test for the existence of files like that.
Actually, I do not think that MP3tag does not test for the existence at all but only treats the files it has loaded.
Also, the syntax is not valid as I think that there is no property called %filename% - it is %_filename%.

If I remember the behaviour of MP3tag correctly, you get a summary of errors after the action is executed - at least if it is only one action.
So I would do the following:
Filter for files that have not yet embedded covers with
%_covers% MISSING
Execute an Action (Quick) of the type "Import cover from file" with the
format string: %_filename%.jpg
Press F3 twice to apply the filter again. Now you should only see those files that still have not got an embedded cover.
Execute an Action (Quick) of the type "Import cover from file" with the
format string: %_filename%.png
Press F3 twice to apply the filter again. Now you should only see those files that still have not got an embedded cover.
These remaining files then have to be treated separately as apparently the filename of the 2 files does not match.


#9

I don't know why underscore is missing, because I wrote with...
File is ''Audio1.mp3'' and Error IS:
"Import cover from file "%_filename%.jpg" (Front Cover): File \?\W:_TEST 2\Audio1.jpg cannot be accessed."
Same problem here !! I don't know why ''_'' is not present !!!!!!!!! :hushed:
(I add a second, because after % there's a problem... Pfiouuuu !!)

I tested your suggestion, and it's the same way of my script.
I realise MP3Tag works special as a specific programm. The syntax is a little hard to assimilate for me, a dummy !! Haha !

Well, my script works but it's not clean.