music-tag icon indicating copy to clipboard operation
music-tag copied to clipboard

Artwork MIME type causing problems

Open xquantxz opened this issue 2 years ago • 5 comments

In a some cases, when adding cover art to file, the type doesn't get recognized and the mime is set to type/None. This causes some problems when working with audio file readers that rely on this to show the artwork.

Maybe it would be better if it could raise an exception so that users can know whats wrong at least.

xquantxz avatar Feb 02 '23 23:02 xquantxz

For example mpv can´t open the artwork. Do you know if there is another way to force the Picture MIME Type?

hasecilu avatar Apr 24 '23 16:04 hasecilu

i have the same issue. file['artwork'].first.mime did not return the corresponding MIME type but None instead.

xiaokang00010 avatar Jan 14 '24 03:01 xiaokang00010

I have the exact same issue, I use music-tag for a python script in which I download an artwork as JPG and then add it. It worked previously, but I lost my old installation and seemingly something broke that. Now, my audio artworks are not working in my Jellyfin instance.

JHubi1 avatar Mar 13 '24 16:03 JHubi1

After trying a bit around, I now know what the problem is: pillow has to be installed. It's not telling you that or something, just figured it out by accident. And I don't mean that you have to do anything, just pip install pillow and it works again

JHubi1 avatar Mar 13 '24 16:03 JHubi1

After trying a bit around, I now know what the problem is: pillow has to be installed. It's not telling you that or something, just figured it out by accident. And I don't mean that you have to do anything, just pip install pillow and it works again

Same here with the following error without pillow:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\ycui\miniconda3\Lib\site-packages\music_tag\file.py", line 603, in __setitem__
    self.set(norm_key, val)
  File "C:\Users\ycui\miniconda3\Lib\site-packages\music_tag\file.py", line 503, in set
    tmap.setter(self, norm_key, val)
  File "C:\Users\ycui\miniconda3\Lib\site-packages\music_tag\mp4.py", line 99, in set_artwork
    raise TypeError('mp4 artwork should be either jpeg or png')
TypeError: mp4 artwork should be either jpeg or png

cyrildtm avatar Aug 15 '24 02:08 cyrildtm