Contents

QLThumbnailImageCreate(_:_:_:_:)

Creates a thumbnail image for the specified file.

Declaration

func QLThumbnailImageCreate(_ allocator: CFAllocator!, _ url: CFURL!, _ maxThumbnailSize: CGSize, _ options: CFDictionary!) -> Unmanaged<CGImage>!

Parameters

  • allocator:

    The allocator to use to create the thumbnail image.

  • url:

    The URL of the file to create a thumbnail image for.

  • maxThumbnailSize:

    The maximum desired size of the thumbnail image.

  • options:

    A dictionary of options that affect the creation of the thumbnail image. You can use Kqlthumbnailoptioniconmodekey and Kqlthumbnailoptionscalefactorkey as options.

Return Value

The thumbnail image, or NULL if Quick Look doesn’t support this file type.

Discussion

This function doesn’t supplant the use of Icon Services by apps to get generic file icons and custom icons stored in the metadata fork of files.

Special Considerations

This function is thread-safe, so you can call it from any thread. However, because it’s synchronous, you should generally call it in a background thread.

See Also

Creating thumbnails