nicfit / eyeD3

eyeD3 is a Python module and command line program for processing ID3 tags. Information about mp3 files (i.e bit rate, sample frequency, play time, etc.) is also provided. The formats supported are ID3v1 (1.0/1.1) and ID3v2 (2.3/2.4).
http://eyed3.nicfit.net/
GNU General Public License v3.0
541 stars 58 forks source link

[Feature Request, Improvement, Help] Display image resolution instead of byte size #557

Open frudolph77 opened 2 years ago

frudolph77 commented 2 years ago

Hey,

the title says it.

$ eyeD3 some.mp3
/some/path/some.mp3                                                                  
-------------------------------------------------------------------------
Time: 03:26 MPEG1, Layer III    [ ~240 kb/s @ 44100 Hz - Joint stereo ]
-------------------------------------------------------------------------
ID3 v2.4:
title: <title>
artist: <artist>
album: <album>
album artist: <album artist>
...
FRONT_COVER Image: **[Size: 105802 bytes]** [Type: image/jpeg]
-------------------------------------------------------------------------

I'm more interested in the image resolution than in the byte size of the images inside a mp3. IMHO the byte size is pretty useless.

I've tried to get this information on my own, but I've very limited knowledge of Python, so I didn't manage it.

Could you give some support how to get the resolution, so that I could implement it myself, or could you add it.

The reason is that I want to update the front cover art in my mp3s where it is below my new preferred size.

Kind regards Frank

nicfit commented 2 years ago

eyeD3 core package does not have any dependency to load the bytes, regardless of image mime-type, and determine the size. That is not the case for the eyeD3 art plugin though, which installs Pillow. i.e. pip install eyeD3[art]. A PR that conditionally adds what you want if, and only if, pillow can be imported and then used to compute and display the size would be welcome though.