Inherits from AFHTTPResponseSerializer : NSObject
Declared in AFURLResponseSerialization.h

Overview

AFImageResponseSerializer is a subclass of AFHTTPResponseSerializer that validates and decodes image responses.

By default, AFImageResponseSerializer accepts the following MIME types, which correspond to the image formats supported by UIImage or NSImage:

  • image/tiff
  • image/jpeg
  • image/gif
  • image/png
  • image/ico
  • image/x-icon
  • image/bmp
  • image/x-bmp
  • image/x-xbitmap
  • image/x-win-bitmap

Tasks

  •   imageScale

    The scale factor used when interpreting the image data to construct responseImage. Specifying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the size property. This is set to the value of scale of the main screen by default, which automatically scales images for retina displays, for instance.

    property
  •   automaticallyInflatesResponseImage

    Whether to automatically inflate response image data for compressed formats (such as PNG or JPEG). Enabling this can significantly improve drawing performance on iOS when used with setCompletionBlockWithSuccess:failure:, as it allows a bitmap representation to be constructed in the background rather than on the main thread. YES by default.

    property

Properties

automaticallyInflatesResponseImage

@property (nonatomic, assign) BOOL automaticallyInflatesResponseImage
Discussion

Whether to automatically inflate response image data for compressed formats (such as PNG or JPEG). Enabling this can significantly improve drawing performance on iOS when used with setCompletionBlockWithSuccess:failure:, as it allows a bitmap representation to be constructed in the background rather than on the main thread. YES by default.

Declared In

AFURLResponseSerialization.h

imageScale

@property (nonatomic, assign) CGFloat imageScale
Discussion

The scale factor used when interpreting the image data to construct responseImage. Specifying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the size property. This is set to the value of scale of the main screen by default, which automatically scales images for retina displays, for instance.

Declared In

AFURLResponseSerialization.h