[GH-ISSUE #255] Feature Request: Higher resolution album art (640×640 instead of 300×300) #159

Closed
opened 2026-02-28 14:25:53 +03:00 by kerem · 5 comments
Owner

Originally created by @leodurandfr on GitHub (Nov 13, 2025).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/255

Hi!
While experimenting with album art URLs returned by go-librespot, I noticed that the API currently retrieves the 300×300 version of Spotify images. However, Spotify also provides a higher resolution version (640×640) using the exact same hash.

What I found

Spotify image URLs follow a predictable pattern.
The size variant seems to depend on a specific segment inside the URL:

  • 00001e02 → 300×300
  • 0000b273 → 640×640

By replacing the size segment returned by go-librespot (1e02) with b273, the image is requested in its higher-resolution form.

Examples

300×300 (current go-librespot output):

640×640 (simply replacing 1e02 with b273):

Would it be possible to:

  • either automatically request the 640×640 variant,
  • or expose an option to choose the desired album art size (e.g. --image-size=max) ?

I'd be happy to test or help with implementation if needed.

Originally created by @leodurandfr on GitHub (Nov 13, 2025). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/255 Hi! While experimenting with album art URLs returned by go-librespot, I noticed that the API currently retrieves the 300×300 version of Spotify images. However, Spotify also provides a higher resolution version (640×640) using the exact same hash. #### What I found Spotify image URLs follow a predictable pattern. The size variant seems to depend on a specific segment inside the URL: - `00001e02` → 300×300 - `0000b273` → 640×640 By replacing the size segment returned by go-librespot (`1e02`) with `b273`, the image is requested in its higher-resolution form. #### Examples **300×300 (current go-librespot output):** - https://i.scdn.co/image/ab67616d00001e02f238784d0bdf3e47a9dc7f55 - https://i.scdn.co/image/ab67616d00001e02c44d4ddea59e4496ab914a3a - https://i.scdn.co/image/ab67616d00001e0241708165385c6f253ea5cacc **640×640 (simply replacing `1e02` with `b273`):** - https://i.scdn.co/image/ab67616d0000b273f238784d0bdf3e47a9dc7f55 - https://i.scdn.co/image/ab67616d0000b273c44d4ddea59e4496ab914a3a - https://i.scdn.co/image/ab67616d0000b27341708165385c6f253ea5cacc Would it be possible to: - either automatically request the 640×640 variant, - or expose an option to choose the desired album art size (e.g. `--image-size=max`) ? I'd be happy to test or help with implementation if needed.
kerem 2026-02-28 14:25:53 +03:00
Author
Owner

@devgianlu commented on GitHub (Nov 30, 2025):

@leodurandfr @breadsander Let me know if #262 does the job for you (already merged).

<!-- gh-comment-id:3592488209 --> @devgianlu commented on GitHub (Nov 30, 2025): @leodurandfr @breadsander Let me know if #262 does the job for you (already merged).
Author
Owner

@leodurandfr commented on GitHub (Nov 30, 2025):

Thanks a lot for this update!

After testing commit a80ad107 which adds the image_size configuration option, I noticed that xlarge doesn't return larger images while large works correctly.

Configuration

Observations

With image_size: "large"

API returns: https://i.scdn.co/image/ab67616d0000b27341708165385c6f253ea5cacc

  • Code ab67616d0000b273 = 640x640 image

With image_size: "xlarge"

API returns: https://i.scdn.co/image/ab67616d00001e0241708165385c6f253ea5cacc

  • Code ab67616d00001e02 = 300x300 image (falls back to default)

Analysis

It appears that Spotify's track metadata (track.Album.Cover) only includes images with sizes DEFAULT, SMALL, and LARGE, but not XLARGE. The getBestImageIdForSize() function correctly looks for the requested
size, but since no XLARGE image is present in the metadata, it falls back to the first available image (DEFAULT).

Possible solutions

large (640×640) is the maximum available size for album covers, and consider removing the xlarge option?

Environment

  • Platform: Raspberry Pi 5 (arm64)
  • OS: Debian Trixie
  • go-librespot: commit a80ad107

Thanks again for adding this feature! The large option already provides a significant improvement

<!-- gh-comment-id:3592639569 --> @leodurandfr commented on GitHub (Nov 30, 2025): Thanks a lot for this update! After testing commit a80ad107 which adds the `image_size` configuration option, I noticed that `xlarge` doesn't return larger images while `large` works correctly. ## Configuration **Observations** With image_size: "large" ✅ API returns: https://i.scdn.co/image/ab67616d0000b27341708165385c6f253ea5cacc - Code ab67616d0000b273 = 640x640 image With image_size: "xlarge" ❌ API returns: https://i.scdn.co/image/ab67616d00001e0241708165385c6f253ea5cacc - Code ab67616d00001e02 = 300x300 image (falls back to default) **Analysis** It appears that Spotify's track metadata (track.Album.Cover) only includes images with sizes DEFAULT, SMALL, and LARGE, but not XLARGE. The getBestImageIdForSize() function correctly looks for the requested size, but since no XLARGE image is present in the metadata, it falls back to the first available image (DEFAULT). **Possible solutions** `large` (640×640) is the maximum available size for album covers, and consider removing the `xlarge` option? **Environment** - Platform: Raspberry Pi 5 (arm64) - OS: Debian Trixie - go-librespot: commit a80ad107 Thanks again for adding this feature! The large option already provides a significant improvement
Author
Owner

@devgianlu commented on GitHub (Nov 30, 2025):

It should probably fallback to large if xlarge is not available, will fix this.

<!-- gh-comment-id:3592966726 --> @devgianlu commented on GitHub (Nov 30, 2025): It should probably fallback to large if xlarge is not available, will fix this.
Author
Owner

@leodurandfr commented on GitHub (Nov 30, 2025):

Did you manage to retrieve any album art in xlarge (larger than 640×640)?

<!-- gh-comment-id:3593483928 --> @leodurandfr commented on GitHub (Nov 30, 2025): Did you manage to retrieve any album art in xlarge (larger than 640×640)?
Author
Owner

@devgianlu commented on GitHub (Nov 30, 2025):

Did you manage to retrieve any album art in xlarge (larger than 640×640)?

I think all I could test was large

<!-- gh-comment-id:3593588868 --> @devgianlu commented on GitHub (Nov 30, 2025): > Did you manage to retrieve any album art in xlarge (larger than 640×640)? I think all I could test was large
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/go-librespot#159
No description provided.