Saving image to camera roll in iOS Safari always converts it to jpg - ios

In my web app (runs in native Safari not UIWebView) I am using canvas to basically allow to draw an image. The user should then be able to save this image to his computer, however it's very important that this process is lossless. That's why I am using the PNG file format.
All this works perfectly on desktop, and in theory it should also work on iOS because by tap and holding the resulting image can be saved to the camera roll. The problem occurs if the image is later imported into the app again. On inspection of the uploaded image type you can see that the image is now in the JPG file format and no longer a pixel perfect representation of the drawing the user made.
Is that a general issue with the camera roll on iOS? Is there any workaround?

YES, The default file format is JPG while saving image to camera roll. You can save a image in PNG format in a native app by writing some code. But in Safari, there may no be possible to save as PNG format.

Related

Plupload with iOS only works for new photos, not for camera roll

I am using plupload 1.5.8 in order to upload image files which works great except for iOS.
On iOS 9.2.x it is not possible to upload from the camera roll, but only from the camera with a fresh picture. I do get the message that the file format is not supported.
Files taken directly with the camera can be uploaded
Screenshots can be uploaded as well from the camera roll, but not images taken with the camera.
The same image that can not be uploaded from the camera roll, can be uploaded from Google Drive
What could be the cause of this?
Finaly fixed: the media type filter contained the "jpeg" format, but the white space between the comma and the format might have caused this problem.

are Asset thumbnail pre-saved in iOS

I am writing an app that relays an image saved on the iOS device to a larger screen. Since a fullRes image is too large and takes long to transfer (using an on-device CocoaHTTP server), I am trying to load thumbnail first.
In Windows, we have a thumbs.db, which means that if we access that, there is no image-resizing etc ... its a thumbnail version of the image pre-saved by the OS.
Does the [UIImage imageWithCGImage:asset.aspectRatioThumbnail] for the ALAsset class in iOS does the same action, or does it load the complete hi-res image and then scales it down before returning?
The documentation does not specify but from my experiments reading the thumbnail is 5 times faster than loading the image from disk (even without decoding or scaling it). I assume iOS stores the pre-made thumbnails somewhere for fast access.

Are there known issues with PNG and JPEG images generated on iOS?

I got the brilliant idea to generate the app store screen shots for my app from... and app! This works great, except for the fact that some of the PNG or JPEG images are not recognized as valid screen shots when I try to upload them. I checked with image viewer, and they have the required size, colorspace and pixel density.
Is there perhaps some strange issues with PNG and/or JPEG images generated on iOS?

Save RGBA image with metadata in iOS

I am working on an iOS application that does some image processing.
The result of the processing is a grey-scale image.
When the process is finished, I want to save the original RGB image together with the result in a same image file to camera roll, so I thought of using alpha channel for that.
Also, I want to attach some parameters got in the processing as image metadata.
So here it comes my problem. I could not find an iOS compatible image format that allows saving alpha channel together with metadata.
On the one hand, JPEG images accept metadata, but not alpha channel.
On the other hand, PNG images accept alpha channel, but not metadata.
Any ideas?
Thanks in advance.
On the other hand, PNG images accept alpha channel, but not metadata.
But yes metadata.

How to save cropped image of an image URL without saving the original image? (in Rails using Paperclip or other plug-ins)

Hi all
I have an app now showing photos from URL, not from my own database (file system).
For example, a photo from Facebook:
http://sphotos.ak.fbcdn.net/hphotos-ak-snc1/hs085.snc1/5041_98423808305_40796308305_1960517_6704612_n.jpg
I've added the crop function to get the cropping area (x,y,w,h) of the photo.
And now I'd like to save the cropped image from the URL (i.e. without downloading the original image to my database before cropping)
Is it even possible?
Or is there anyway to get the image into memory to process without saving it to database?
I've searched some questions here, but they all talk about how to save the crop of images which have been uploaded to the database by users.
Thank you very much in advance.
How do you imagine cropping works without access to the original image? The process would be like this:
Download the remote image to a /tmp as a temporary file (Tip: TempFile)
Crop the crap out of it
Save the cropped image with Paperclip to your DB
Remove the temporary file

Resources