Skip to content

Instantly share code, notes, and snippets.

@zbuc
zbuc / ScreenshotManager.m
Created February 26, 2012 11:13
NSImage base64 HTTP POST
- (void)uploadImage:(NSImage *)image
{
NSData *imageData = [image TIFFRepresentation];
NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:imageData];
imageData = [imageRep representationUsingType:NSPNGFileType properties:nil];
NSString *base64 = [imageData encodeBase64WithNewlines: NO];