Cover Dimensions
The following method creates two tag fields to hold the wide and height values from the first stored cover.
You need a helper tool called IrfanView which extracts the information from the picture.
1.
In Mp3tag grid view mark the tracks to be changed.
2.
Run the actiongroup Get Cover Info Step 1 Export Covers against the selection.
Begin Actiongroup Get Cover Info Step 1 Export Covers
Action #1
Actiontype 5: Format tag field
Field: COVER_PATH
Formatstring: $replace(%_folderpath%%_filename%,,`,:,)
Action #2
Actiontype 4: Replace with regular expression
Field: COVER_PATH
Regular expression: [^\x2F-\x7F]
Replace matches with:
Action #3
Actiontype 5: Format tag field
Field: COVER_PATH
Formatstring: O:\TEST\COVERS\%COVER_PATH%
Action #4
Actiontype 13: Export cover image to file
Formatstring for image filename: %COVER_PATH%
End Actiongroup Get Cover Info Step 1 Export Covers (4 Actions)
You may change the path to the working folder to fit your needs.
Change in Action #3 the partial string 'O:\TEST\COVERS' to the location of your choice.
3.
Run actiongroup Get Cover Info Step 2 Create Batch against the selection.
This actiongroup creates a batch command file in the working folder.
4.
Get Cover Info Step 3 Run Batch
Use some File Explorer and look into the working folder, e. g. 'O:\TEST\COVERS'.
There is a bunch of jpg files as the result from the previous actiongroup run.
There is a txt file named 'Mp3tag.iview.info.cmd.txt'.
To set the batch command file ready to work just delete the extension '.txt' to name it 'Mp3tag.iview.info.cmd'.
Make sure that the helper application 'IrfanView' (i_view32.exe) is installed and accessible by the batch command file.
Look into the Mp3tag export file 'Export BAT for IrfanView Info.mte' and change the environment variable APP as needed.
Change the working folder to the same folder as before, see line
'$filename(O:\TEST\COVERS\Mp3tag.iview.info.cmd.txt,ansi)'.
Run the batch command file 'Mp3tag.iview.info.cmd'.
The batch command file creates a bunch of txt files in the working folder.
5.
Switch back to Mp3tag.
Run the actiongroup Get Cover Info Step 4 Set Tags against the selection.
Begin Actiongroup Get Cover Info Step 4 Set Tags
Action #1
Actiontype 14: Import text file
Field: COVER_INFO
Filename: %COVER_PATH%.txt
Action #2
Actiontype 4: Replace with regular expression
Field: COVER_INFO
Regular expression: [\r\n]
Replace matches with:
Action #3
Actiontype 5: Format tag field
Field: COVER_WIDTH
Formatstring: %COVER_INFO%
Action #4
Actiontype 5: Format tag field
Field: COVER_HEIGHT
Formatstring: %COVER_INFO%
Action #5
Actiontype 4: Replace with regular expression
Field: COVER_WIDTH
Regular expression: ^(.Image÷dimensions÷=÷)(\d+)(÷x÷)(\d+)(÷÷Pixels.)$
Replace matches with: $2
Action #6
Actiontype 4: Replace with regular expression
Field: COVER_HEIGHT
Regular expression: ^(.Image÷dimensions÷=÷)(\d+)(÷x÷)(\d+)(÷÷Pixels.)$
Replace matches with: $4
Note: Replace one special character ÷ with one space character.
End Actiongroup Get Cover Info Step 4 Set Tags (6 Actions)
6.
Cleanup.
Run the actiongroup Get Cover Info Step 5 Remove Temp Tags against the selection.
Begin Actiongroup Get Cover Info Step 5 Remove Temp Tags
Action #1
Actiontype 9: Remove fields
Fields to remove (semicolon separated): COVER_PATH;COVER_INFO
End Actiongroup Get Cover Info Step 5 Remove Temp Tags (1 Action)
Remove all files from the working folder.
7.
Add new columns to the Mp3tag grid view.
[#..]
width=72
numeric=1
name=Cover Width
value=%COVER_WIDTH%
sort=
field=
enabled=1
[#..]
width=72
numeric=1
name=Cover Height
value=%COVER_HEIGHT%
sort=
field=
enabled=1
or combine the two values in one column
[#..]
width=100
numeric=0
name=Cover Dim
value=[%COVER_WIDTH% x %COVER_HEIGHT%]
sort=$mul(%COVER_WIDTH%,%COVER_HEIGHT%)
field=
enabled=1
8.
Ready.
mta files:
Get_Cover_Info_Step_1_Export_Covers.mta (221 Bytes)
Get_Cover_Info_Step_2_Create_Batch.mta (107 Bytes)
Get_Cover_Info_Step_3_Run_Batch_external.mta (3 Bytes)
Get_Cover_Info_Step_4_Set_Tags.mta (393 Bytes)
Get_Cover_Info_Step_5_Remove_Temp_Tags.mta (41 Bytes)
mte file:
Export_BAT_for_IrfanView_Info.mte (1.69 KB)
Good luck, folks!
(How easy would it be to have cover dimension support by native Mp3tag!)
DD.20080306.2130.CET
Get_Cover_Info_Step_2_Create_Batch.mta (107 Bytes)
Get_Cover_Info_Step_3_Run_Batch_external.mta (3 Bytes)
Get_Cover_Info_Step_4_Set_Tags.mta (393 Bytes)
Get_Cover_Info_Step_5_Remove_Temp_Tags.mta (41 Bytes)
Export_BAT_for_IrfanView_Info.mte (1.69 KB)
Get_Cover_Info_Step_1_Export_Covers.mta (221 Bytes)