<!--
{
  "availability" : [
    "macOS: 10.0.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "QuickLook",
  "identifier" : "/documentation/QuickLook/QLThumbnailRequestSetImageWithData(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Quick Look"
    ],
    "preciseIdentifier" : "c:@F@QLThumbnailRequestSetImageWithData"
  },
  "title" : "QLThumbnailRequestSetImageWithData(_:_:_:)"
}
-->

# QLThumbnailRequestSetImageWithData(_:_:_:)

Sets the response to the thumbnail request to image data saved within the document.

```
func QLThumbnailRequestSetImageWithData(_ thumbnail: QLThumbnailRequest!, _ data: CFData!, _ properties: CFDictionary!)
```

## Parameters

`thumbnail`

The thumbnail request object.

`data`

The image data, which must be in a format supported by the Image I/O framework (JPG, PNG, and so on). In other words, a content type of `kUTTypeImage` is assumed. (`ImageIO.framework` is a subframework of the umbrella Application Services framework.)

`properties`

A dictionary of properties. The only property that you can currently specify is kCGImageSourceTypeIdentifierHint; see [Quartz 2D Programming Guide](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001066) for information about this property.

## Discussion

This function returns the thumbnail as a `CFData` object containing image data. The document’s application must save this data as part of the document’s data; the generator retrieves it and uses this function to return it to the client. Before you call this function, call [`QLThumbnailRequestGetMaximumSize(_:)`](/documentation/QuickLook/QLThumbnailRequestGetMaximumSize(_:)) to obtain the maximum allowed size for the thumbnail and resize the image if necessary.

### Special Considerations

Thread-safety: This function should be called in the same thread as the thumbnail request is made in; generally, this is the same thread in which the `GenerateThumbnailForURL` callback was invoked.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)