I have stored some pictures using Safari's "Hold + Save image" option in my Photo Library in the simulator . When I take any image from the library, I have to convert it to JPEG or PNG so that I can upload it to the server. The issue is that the size of the original image is approximately 200 KB, but after converting to PNG, the image is approximately 2 MB. I am converting UIImagePNGRepresentation
to UIImage
object to NSData and then posting an image.
-
What am I missing here? Why is the size of the picture larger than its original size?
-
Can I determine the type of image loaded from the library of photos?
-
Is the iPhone the default type of images captured by the camera?
I'm guessing that the original image is JPEG Is stored in.
PNG is designed to store things like screen shots and line drawings. It is not designed to store things like photos.
All this comes under the compression used, PNG uses lossless compression so that the image will be the same as the original image JPEG uses lossy compression, the resulting image is an estimate for the original .
If you take a lossy JPEG and save it as a PNG, then it will increase in size, often you have a large amount of sight.
The solution to your problem is nothing to do in your pictures before uploading them. They should already have PNG, GIF or JPEG images. You should do this.
The format of images saved by the iPhone camera is JPEG.
Like the sound you probably need to read something and usually do.
Comments
Post a Comment