SLRequest get image Headers(width and height) without downloading

132 Views Asked by At

i am creating cells with width and height of UIImage.
i am getting the images from Facebook post OR twitter Feed.

Currently i just can set the cells size AFTER downloading the image and this leads to delaying.

So my question is: is it possible to get the image headers WITHOUT downloading the image itself with folling Frameworks/SDKs:

  • SLRequest
  • Facebook SDK
  • Twitter Api

i only need the header informations of the images for layouting my UI.
Any recommendations or experiences about that?

1

There are 1 best solutions below

1
On

If you know that the information you want is returned in the header then you could try:

  1. Get an NSURLRequest request with preparedURLRequest
  2. Make a mutableCopy of it
  3. Call setHTTPMethod: with @"HEAD" to specify you only want headers

Note that if the server doesn't support HEAD requests then the image data would generally be returned anyway (usually instead of an error)...