FWImageResponseSerializer


@interface FWImageResponseSerializer : FWHTTPResponseSerializer

FWImageResponseSerializer is a subclass of FWHTTPResponseSerializer that validates and decodes image responses.

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

  • application/octet-stream
  • image/tiff
  • image/jpeg
  • image/gif
  • image/png
  • image/ico
  • image/x-icon
  • image/bmp
  • image/x-bmp
  • image/x-xbitmap
  • image/x-ms-bmp
  • image/x-win-bitmap
  • image/heic
  • image/heif
  • image/webp
  • image/svg+xml
  • 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.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat imageScale;
  • 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.

    Declaration

    Objective-C

    @property (nonatomic) BOOL automaticallyInflatesResponseImage;