Reputation: 1
For my iPhone Web App, since the 3G network is very slow, it cannot upload a large photo. Thus, I want to reduce the photo size before I upload it into a server. I tried to use CANVAS HTML 5
, which works in Android but not in iOS 7 or 8.
Are there any other methods that I can use to reduce the photo size before upload?
Upvotes: 0
Views: 180
Reputation: 7826
You can use UIImageJPEGRepresentation
or UIImagePNGRepresentation
to compress the photo.
compressionQuality
The quality of the resulting JPEG image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality).
See more info: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/
Upvotes: 1