2

I am currently working on iPhone feedback type of application. Where users can take multiple of images from camera. And also he can give feedback and remark on that. So, I need to send both text and images to the server. For that I have created one entity class with all their attributes (all texts and images). So at the time only I need to send more than 70 thumbnail images via POST using single php url. Because of the large memory size of JSON data Can we send image to the server by using his image UUID instead of data?

Max limit of POST is about 8MB by default.. Can we send image UUID to the server instead of image data or is there any other way?

here is my code :

+ (NSString *)getNewGUID
{
    CFUUIDRef theUUID = CFUUIDCreate(NULL);
    CFStringRef string = CFUUIDCreateString(NULL, theUUID);
    CFRelease(theUUID);
    return (__bridge NSString *)string;
}

If I will use image UUID then is an image will display in other iPhone devices also?

Please, help me out of this.

liushuaikobe
  • 2,152
  • 1
  • 23
  • 26
Anand Gautam
  • 2,541
  • 3
  • 34
  • 70
  • I'm not sure what the "image UUID" means? Why you want to upload 70 thumbnail images a one time? – Joiningss Dec 02 '13 at 08:52
  • @joiningssThanks for rpy, Check my updated question..for creating image UUID – Anand Gautam Dec 02 '13 at 09:36
  • @JoiningssHi..Can u pls see this link and give me some idea for this...http://stackoverflow.com/questions/20495417/issue-save-an-image-file-to-resource-folder-in-iphone – Anand Gautam Dec 10 '13 at 16:30

1 Answers1

0

The uuid doesn't contains all the information that the image contains, and the server can't get the full image therefore it couldn't display those images on other devices only by the uuids. You must upload images themselves.

Even the Base64-encoded binary data (convert the image to plain text) of the image is 1.37 times the original data size roughly according to this.

To reduce the size of the data transferred between client and server, you can do some image-resizing works, for example:

- (UIImage*)resizeImage {
    CGRect drawRect = RECT_WITH_NEW_SIZE_HERE;
    CGSize newSize = drawRect.size;

    UIGraphicsBeginImageContext(newSize);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextClearRect(context, CGRectMake(0, 0, newSize.width, newSize.height));

    CGContextSetInterpolationQuality(context, kCGInterpolationMedium);

    [YOUR_IMAGE drawInRect:drawRect blendMode:kCGBlendModeNormal alpha:1];

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    return image;
}
Community
  • 1
  • 1
liushuaikobe
  • 2,152
  • 1
  • 23
  • 26