Reputation: 10108
I'm working on an iPhone app that lets the user pick an image from the camera roll, manipulate it (filters, effects, etc.) and then share it on several social networks (Facebook, Twitter, etc.).
When I use the email app to send the final result (I use the UIImage and send it to the email app) I sometimes get an image which is 10 times the size of the original image (6MB instead of 600KB). When I save the final result to the camera roll (UIImage) everything works like it should and the size of the image is reasonable.
When I try to share to Facebook and Twitter it sometimes takes A LOT of time (I guess this is because the size of the image is 6MB instead of 600KB).
What is the reason for this and how can I fix that?
Upvotes: 0
Views: 175
Reputation: 801
compress your image to JPG image
UIImage *convertedImage = UIImageJPEGRepresentation(originalImage, /*compressionQuality*/ 0.5);
Upvotes: 0
Reputation: 190
For sure you need to compress your image and then send it to which ever server you want .. the link below may help you
How to compress/resize image on iPhone OS SDK before uploading to a server?
Upvotes: 1