11
  if($song->artwork_url != null) {
      $song_artwork = $song->artwork_url;
  }
  else {
      $song_artwork = 'img/no_art.png';
  }

By default soundcloud pulls -large (which is 100x100)

How do i make it pull (t500x500) so i can have a higher res image?

fthiella
  • 48,073
  • 15
  • 90
  • 106
Black Dahlia
  • 141
  • 1
  • 1
  • 6

3 Answers3

27

Just replace large.jpg by t500x500.jpg in the filename, like so:

  $song_artwork = str_replace('large.jpg', 't500x500.jpg', $song->artwork_url);

In fact, they support a number of different formats for different requests:

t500x500:     500px×500px
crop:         400px×400px
t300x300:     300px×300px
large:        100px×100px  (default)
t67x67:       67px×67px    (only on artworks)
badge:        47px×47px
small:        32px×32px
tiny:         20px×20px    (on artworks)
tiny:         18px×18px    (on avatars)
mini:         16px×16px
original:     originally uploaded image

I found the documentation in the Soundcloud API reference, search for artwork_url.

likeitlikeit
  • 5,563
  • 5
  • 42
  • 56
  • 1
    Just be aware that for some tracks, `original` exists but `t500x500` doesn't, for some the opposite. It's a total mess. – Dan Abramov Nov 05 '14 at 15:08
  • 1
    I wrote an [express app](http://stackoverflow.com/a/26806356/458193) that redirects to largest non-404 version of the image. – Dan Abramov Nov 07 '14 at 17:05
6

For client side a simple JS .replace() will do the job

SC.get("/users/984878/tracks", {limit: 10}, function(tracks){

$.each(tracks, function(index,track){

lrgart = track.artwork_url;
lrgart = lrgart.replace('-large', '-t500x500');

});
ryan hickman
  • 71
  • 1
  • 1
0

@likeitlikeit's answer worked for me, however I had to change the file extension for the 'original' size to png even though the smaller images were jpg, so try that if your first attempt is not found

Mark Tickner
  • 1,023
  • 2
  • 15
  • 26