iosuiimageviewfile-extensionsdwebimage

Loading an image using SDWebImage with no file extension


So I'm using SDWebImage to load images asynchronously in my iOS UITableView. To do this I call:

[cell.itemImageView setImageWithURL:imageUrl placeholderImage:[UIImage imageName:@"placeholder.png"]];

Where imageUrl might be:

imageUrl = [NSURL URLWithString:@"http://example.org/image.png"];

This all works fine, however the server API I'm using will occasionally return an image without an image extension. In this case SDWebImage appears to not attempt to load the image. Is there anyway I can force it to download the image? I cannot just append .png to the image as this causes permissions issues where the image is hosted.

EDIT: I have just ran this on a example image currently hosted (the GUID is the filename):

curl -i -X HEAD http://example.org/images/98b67f6a-671c-482c-8e3b-0ade8bfa01be

And it returns with this:

HTTP/1.1 200 OK
x-amz-id-2: UGcGcyUuUfWBD2YrhmfoRq8oiXIwEkBJ9x4TdimLAcPc9Yim26tRRgjN/PVBak+S
x-amz-request-id: 513EDF3EB400DE6E
Date: Mon, 12 Aug 2013 16:03:08 GMT
Last-Modified: Thu, 13 Jun 2013 01:28:50 GMT
ETag: "96ca8a122a94c97eee83ef685c7e2e7b"
Accept-Ranges: bytes
Content-Type: image/jpg
Content-Length: 17631
Server: AmazonS3

Solution

  • Not really an answer but to resolve this I ended up changing the server to save images with their extension.