KristoforMaynard / music-tag

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

Artwork not showing up in iTunes #14

Closed Retro-R closed 1 year ago

Retro-R commented 3 years ago

I'm using a mac, and i've saved my artwork from url. It shows up fine in like the finder folder, as in it shows the artwork in the preview but when i open it in iTunes the artwork doesn't display. idk if this is something wrong w iTunes or something but i was just curious if anyone else had this issue and how they solved it.

KristoforMaynard commented 3 years ago

Not enough information to understand the issue.

hammady commented 1 year ago

I have the same question. I did the following:

tags = music_tag.load_file(media_path)
with open('artwork.jpg', 'rb') as img:
  tags["artwork"] = img.read()
tags.save()

Here is OneDrive link to the file: https://1drv.ms/u/s!Aq1PMiDnHe9tk5Ygn_JVNQ3vMPjNjQ?e=3yBrB2

macOS Finder:

image

Mp3Tag (macOS app):

image

iTunes Library (Apple Music):

image

Clearly there is a compatibility issue. I have 40GB of media files that I want to sync to my Apple devices, all of them missing the artwork which is important. Any help is appreciated!

hammady commented 1 year ago

Finally a solution: Just make sure Pillow is installed before setting the artwork tag! I discovered this by chance when I was trying to set the thumbnail and I knew from the docs that thumbnails require Pillow. While tagging around 1200 files, 3 of them crashed with the below error when setting the artwork itself, before the thumbnail, so I knew something is being done differently! Now they all show in iTunes.

The error:

  File ".venv/lib/python3.11/site-packages/music_tag/file.py", line 187, in __init__
    depth = mode2depth[img.mode]
            ~~~~~~~~~~^^^^^^^^^^
KeyError: 'LA'

Apparently some JPEG files have an unsupported mode, but that's another issue.

hammady commented 1 year ago

Created issue #44.