KristoforMaynard / music-tag

Simple interface to edit audio file metadata
MIT License
118 stars 19 forks source link

Artwork MIME type causing problems #38

Open xquantxz opened 1 year ago

xquantxz commented 1 year ago

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.

hasecilu commented 1 year ago

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

xiaokang00010 commented 8 months ago

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

JHubi1 commented 6 months ago

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 commented 6 months ago

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

cyrildtm commented 1 month ago

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