Artist & Album Artwork
It would make developers invariably happy if we never had to deal with graphics & images, but unfortunately that would probably result in the most boring music store user interface ever (though, imagine how fast it would be!) So, Rhymba also provides robust options for retrieving & manipulating album cover artwork, as well as a limited amount of artist images.
Album artwork & artist images are not secured and accessible from the ib3-lb.mcnemanager.com domain. You can use either the basic URL structure, which returns the full-size artwork originally provided to us, or the advanced URL structure, which exposes cropping, scaling, and effects to you.
All of those advanced options are a part of our Rhymba Images (née ImageBank) platform, and will be covered much more in-depth in future versions of the documentation. But, here're the basics.
Retrieving Album Covers
Basic Usage: http://ib3-lb.mcnemanager.com/123456.cover
+ Scaling & Cropping: http://ib3-lb.mcnemanager.com/scl/2/crp/11/sz/300/250/123456.cover
+ Fallback Image: http://ib3-lb.mcnemanager.com/scl/2/crp/11/sz/300/250/123456.cover?dflt=defaultImageOption
+ Reflections: http://ib3-lb.mcnemanager.com/scl/2/crp/11/sz/300/250/rfl/0/30/45/2/20/123456.cover?dflt=defaultImageOption
Retrieving Artist Images (Where Available)
Basic Usage: http://ib3-lb.mcnemanager.com/123456.artist
+ Scaling & Cropping: http://ib3-lb.mcnemanager.com/scl/2/crp/11/sz/300/250/123456.artist
+ Fallback Image: http://ib3-lb.mcnemanager.com/scl/2/crp/11/sz/300/250/123456.artist?dflt=defaultImageOption
+ Reflections: http://ib3-lb.mcnemanager.com/scl/2/crp/11/sz/300/250/rfl/0/30/45/2/20/123456.artist?dflt=defaultImageOption
The URL Parameters
You'll want to provide the artist or album ID in the URL by replacing 123456 in the example URLs with the relevant album or artist ID from our platform. The basic usage above will then return the fullsize image we were provided... but you probably don't want that. Fortunately, you can specify scaling, cropping, and other options as a part of your URL.
Size, Scaling & Cropping
Rhymba Images lets you specify various cropping & scaling options when retrieving its hosted images.
The desired size is indicated in the request URL in the format sz/width/height/, in pixels, and also takes into account the scaling option below. Scaling is implemented through Rhymba Images's image processing library. Size should also take into account any reflection parameters specified.
The scl/2/ parameter in the request URL directs Rhymba Images to apply the selected scale type ID when resizing the image (in this example, 2). The scaleTypeIds are implemented through Images's image processing tools, and are as follows:
- No scaling.
- Inside bounding box. Scales the image proportionally to fit inside the height and width without requiring cropping. For example an image that was 200x100 that was to be scaled to 50x50 with this option would then be scaled to 50x25.
- Overflow bounding box. Scales the image proportionally until either the height or the width of the image fits inside the desired height and width. This will usually leave edges that need to be cropped off or the image returned will be larger than the desired height and width. For example an image that was 200x100 that was to be scaled to 50x50 with this option would only be scaled to 100x50 then a cropping type should be used to return a 50x50 thumbnail.
Besides scaling to a specific size, Rhymba Images allows you specify what crop point should be used in combination with the scale type ID. Crop type is indicated in the request URL in the format crp/11/, where in this example 11 is the crop type ID. The cropTypeIds are implemented through Images's image processing tools, and are as follows:
- No cropping.
- Smart crop. Uses the dimensions of the image to center the cropping point for a landscape (i.e. more wide than tall) image and moves the cropping point to the top for a portrait (i.e. more tall than wide) image.
- Centered. Crop point is always image center.
- Top center.
- Top left.
- Top right.
- Bottom center.
- Bottom left.
- Bottom right.
Fallback Images & 404s
If an image does not exist for an artist or album, a default image can be returned. The default behavior returns an absolutely beautiful, classy, world-changing picture1 of a music note. This behavior can be modified by adding the optional dflt variable to the query URL in one of two ways.
- ?dflt=404 will cause an HTTP 404 error to be returned.
- ?dflt=filename.jpg will return a custom image defined by the filename.
To use a custom default image or have one designed, contact VL Group. We will need to load the default image into Rhymba Images before you can use it. Any number of custom default images can be used so that applications implementing the API can specify different filenames in different locations. An example usage of multiple custom default images might use dflt=defaultArtist.jpg for artist images, and dflt=defaultCover.jpg for album covers.
1 This copywriter may or may not be biased, as he may or may not have been the person that initially created said default image many years ago.