I am using cropper.js to crop an image. But it looks like when I am cropping the image in an iphone/ipad sometimes (not always) the canvas is rotated but only for portrait images. I searched and found out that it's a canvas issue with iOS. Is there any way that I could make it work ? I tried to used the exif metadata from the image and get the orientation but then I found that the not all the images have the exif metadata (some people can remove them and png images don't have those metadata at all). Any suggestions on how I could fix this rotation problem?
Related
I'm trying to figure out a way to read DNG image resolution without actually loading the image using CIFilter. So far I tried:
CGImageSourceCopyMetadataAtIndex - doesn't have any resolution info at all in returned dictionary
CGImageSourceCopyPropertiesAtIndex - has only resolution of the embedded preview image
What do I miss? I'm sure there are apps that read that info somehow or do they use 3d party libs like libexif?
Never mind. CIFilter does not process the image unless it's rendered. But the image properties are available immediately through CIImage
I have built responsive website which works great on all devices except iOS.
On iOS devices, my background images get blurry.
Here is link to my website. http://www.idynxschool.com/vesco/
You can view it on iPhone and you will find blurry images. Is this something to do retina ready images?
Any solution will be really appreciated.
Thanks
In Safari on iOS, there is a known limitation when displaying large PNG and GIF images. The issue is triggered by the overall number of pixels in the image, so even if an image is narrow, you can experience blurriness if the image is tall enough.
This affects both the iPad and iPhone and affects all models of device. However, the exact image size that triggers the issue varies from iPhone to iPad and between models. For example, if you’re creating an image for iPhone 6 Plus that is 1080px wide, then the image can be up to ~4800px tall before blurriness would occur.
If you use JPG instead of PNG or GIF, then you may see less blurriness since the limit is increased for JPG images. For PNG or GIF images, however, the only way to work around this issue at current is to reduce the dimensions of the image until they’re below the limit that causes the issue.
Answer found: https://support.invisionapp.com/hc/en-us/articles/204660949-Why-are-my-images-in-iOS-blurry-
I'm using UIImagePickerController to snap an image and uploading it to server.
When taking a photo in the front camera, the height/width get reversed somewhere.
The image is displayed correctly later, but height and width are reversed (and I'm using them for the UIImageView autolayout constraint)
The thing is - that when looking at UIImagePickerControllerMediaMetadata of front and back camera images - the EXIF and the rest of the metadata is the same (resolution is smaller but the height/width ratio is the same)
Any ideas what is the difference?
Apple images are always landscape left with EXIF and the orientation is specified in the EXIF.
OK, so #zaph comment is correct, apparently back camera images are "reversed" as well - the upload code in the server (Codeigniter PHP) ignored the EXIF.
The problem surfaced only due to front camera low resolution...
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?
I'm using UIImagePickerController to fetch images from the user's photo library and/or taken with the camera. Works great.
I'm noticing that fetched images are often (always?) coming back with their imageOrientation set to UIImageOrientationRight. But the image was captured with the device in portrait orientation. Why is this? This is an iPhone4S, iOS6, using the rear camera - so the resolution is 8MP.
In the simulator, grabbing photos from the photo library, images come back UIImageOrientationUp.
When I display the image in a UIImageView the orientation looks correct (portrait/up). But when I go to crop the image the coordinate system isn't what I would expect. 0,0 is in the upper-right of the image, which I guess makes sense when it reports UIImageOrientationRight.
I'm looking for an explanation of what's going on and the correct approach to dealing with the odd coordinate system.
EDIT: it sure appears to me that, on iPhone4S at least, the camera always takes UIImageOrientationRight/"landscape" images, and that UIImageView is respecting the imageOrientation on display. However, if I save the image using UIImagePNGRepresentation the orientation is not preserved (I think I read about this somewhere.)
It has to do with the orientation the phone was in when the image was taken. The phone doesn't rotate the image data from the camera sensor to make up in the image be up but instead sets the imageOrientation and then UIImage will take care of rendering things the right way.
When you try and crop, you typically change the image to be a CGImage and that loses the orientation information so suddenly you get the image with a strange orientation.
There are several categories on UIImage that you can get that will perform image cropping while taking imageOrientation into account.
Have a look at link or link