Skip to content

Instantly share code, notes, and snippets.

View barbaramartina's full-sized avatar

Bar barbaramartina

View GitHub Profile
// See http://mindsea.com/2012/12/18/downscaling-huge-alassets-without-fear-of-sigkill for details
#import <AssetsLibrary/AssetsLibrary.h>
#import <ImageIO/ImageIO.h>
// Helper methods for thumbnailForAsset:maxPixelSize:
static size_t getAssetBytesCallback(void *info, void *buffer, off_t position, size_t count) {
ALAssetRepresentation *rep = (__bridge id)info;
NSError *error = nil;