It's possible that there is some issue with how you are reading or encoding the image data that is causing it to be incompatible with Mutagen. The data that you pass to Mutagen should be a bytes object containing the image data in the appropriate format. It's possible that some of the images you are trying to use have different metadata or compression settings that make them incompatible with Mutagen.Īnother possibility is that the image data you are passing to Mutagen is not correctly formatted or is not being encoded correctly. Mutagen supports JPEG, PNG, and GIF image formats, but not all image files in those formats may be compatible with Mutagen. One possibility is that the image file you are using is not in a format that is supported by Mutagen. There could be a few different reasons why the album art is not being set correctly for some images. Interestingly, it does not work when downloaded by my program using requests.ĭoes the problem stem from some kind of meta data in the images? If not, why the discrepancy? webp file and so I used to convert it to a jpeg. This is the image that does work "" though it downloaded as a. It also doesn't work when manually downloading it from my browser. It gets saved as "temp-album-art.jpg" just fine but doesn't work when trying to use it as the album art using mutagen. R = requests.get("") #this is the URL that is automatically generated by my program.ĭata=open("temp-album-art.jpg", 'rb').read() Here is my code: from mutagen.mp3 import MP3 The weird thing, though, is that some images that I manually download from my browser work just fine. However, when I download that image using requests and then use mutagen to set that image as the album art of my mp3 it doesn't return any errors but the album cover is unchanged on my mp3. I have a python program that reads an mp3 and returns a URL of it's album art.
0 Comments
Leave a Reply. |