Otiel / BandcampDownloader

A Windows app used to download albums from Bandcamp.
Other
962 stars 76 forks source link

Set correct extension for original artwork #254

Open DarkVoyage opened 7 months ago

DarkVoyage commented 7 months ago

Set extension to what is actually acquired: JPG, PNG, GIF (very rare). Currently everything is named as JPG, which leads to either errors on opening (though XnView doesn't care for extension, reads header) or need to rename everything by hand, but first search for wrong extensions some way. Half of covers are PNG.

Otiel commented 6 months ago

Have you tried unchecking those options?

image

which leads to either errors on opening

This shouldn't happen. When those options are checked, a conversion is performed on the artwork, not simply a rename of the extension. Do you have a reproducible case that I could test?

DarkVoyage commented 6 months ago

image

Sure, try downloading this: https://lisabelladonna.bandcamp.com/album/electronic-voyages-3 You will get PNG with .jpg extension. It is hardcoded. In options better write .ext or .extension than .jpg.

Otiel commented 6 months ago

Seems like a big, thanks for reporting this. 👍

DarkVoyage commented 6 months ago

It is in JsonAlbum.cs

internal class JsonAlbum { private readonly string _urlEnd = "_0.jpg";

But you can't simply change it to anything. You should read first bytes of downloaded file to get the type.