how to stop iMessage link preview from rotating image - imessage

When sharing links from my website, sometimes the images are rotated 90 degrees.
https://dw2h1frcjb7pw.cloudfront.net/1a5765ac5b5e7c0356a5eaf208c53a290fd8497ef1907e32212888f1c2094cbd
https://primitives.xyz/claim/1aE14KJuHOQKkbP5cjtMsV
How do I fix this? In all my extensions for testing previews it displays correctly.

Related

Drupal 8 - photos uploaded using iOS devices are rotated

When using iOS devices such as the iPhone (and possibly other devices; not Android devices however), photos taken and uploaded in drupal 8 are rotated to a 90 degree angle.
For example, images taken and uploaded vertical are posted horizontal.
Images taken and uploaded horizontal are posted upside down.
Any help would be appreciated
Many thanks
------------------EDIT---------------
I'm currently using Drupal 8's code, so the code is in its original state.
Is there a way to not change the code and download a module or something which can correct the problem?
Below is an example of how images are automatically rotated from the uploaded/original image and posted image...
Example 1

Flash CameraUI orientation is wrong

We're developing an AIR app for android and iOS. An important part of the app is taking photos. Using flash.media.CameraUI works perfectly on android, but we experience problems on iOS.
In the iOS camera application, when we rotate the iPad, the orientation is wrong: If we rotate the pad clockwise, the image is rotated anticlockwise. The UI buttons have the correct orientation though, and when the photo is taken, the resulting bitmap has the right orentation based on the orientation of the camera, not the actual view on the screen.
Looking at different camera apps, I notice that when the pad is rotated so the orientation changes clockwise, the camera does three things: First, the displayed image immediately becomes rotated 90 degrees anti-clockwise (so it looks wrong). Then, the image slowly rotates 90 degrees clockwise, to restore the correct orientation. In addition, the UI buttons change orientation so the text is displayed correctly.
It seems as in our app, it only rotates the image slowly without doing the first immediate rotation. Thus, the end result is wrong.
Anyone know how to fix this?
After some more research, I found that the issue isn't just restricted to AIR.
UIImagePickerController camera view rotating strangely on iOS 8 (pictures)

How do you capture full screen camera photos on iOS?

On Snapchat, it allows you to take a full screen camera photo on iOS. The preview is full screen, and the image returned is full screen. There appears to be no cropping/stretching/etc... What you see is what you get.
Now I've looked all over the place, and I can't figure out how this is actually being done, seeing that the iPhone camera always returns an image with an aspect ratio of 4:3. Yes, you can use the camera view transform to have a full screen "preview", but the image returned is still 4:3 and needs to be cropped.
So my question is, how do you take a full screen camera photo on iOS without cropping? If your answer is that it can't be done, then how is Snapchat doing it (or appearing to do it)?
Snapchat isn't displaying everything the camera is picking up. By cropping a bit from the top/bottom or sides, they can create a 16:9 image from a 4:3 image. This is easy to verify.
Open up the snapchat and camera apps so it's easy to switch between them.
Place your phone on its side pointed at something with some marks for reference points.
Switch between the apps without moving the phone. There is content that you do not see on Snapchat.

Captured photo automatically rotated during upload in IOS 6.0 or iPhone

I have one HTML file control using this i am trying to upload file on server.
Click on file control
It will automatically open dialog for file/camera selection.
I select Camera
I captured photo and save
Now submit form
the Capture photo save successfully on server but it is rotated 90
degree.
This problem is only with iPhone or IOS.
<input id="image" name="image" type="file" accept="image/*" capture style="width: 58px" />
Please let me know, how to stop automatic rotation of image if captured from camera.
Thanks,
Imdadhusen
This could have something to do with EXIF/TIFF metatags in the images.
One of these tags indicates the orientation of the image. Some photos you upload to a server (eg from the iPhone) may have these tags, others (from a different source / workflow) may not. The server may or may not retain these tags, and may or may not read the tags in order to attempt correct orientation of the image. Similarly a web browser may or may not pay attention to these tags. If you upload images containing tags, the results will certainly be unpredictable.
A good way to find out if this is the issue would be to download a 'problem' image and a 'good' image from the server, and compare them. Open them in preview and check the second tab of the Inspector. Any meta-info will be displayed there. See if one image has orientation info and the other not. If neither display meta-info then it is fairly likely the server is stripping it all out and not using it, and you can forget about this answer.
Also you should compare in different browsers. Some browsers read this orientation info and rotate the image accordingly, others do not.
For example, an iPhone photo of mine which was take in portrait mode has the following metatags:
Pixel Height: 2,448
Pixel Width: 3,264
Orientation: 6 (Rotated 90° CCW)
The native bitmap orientation is landscape.
The 'orientation' metatag indicates to image reading software to rotate to portrait for display.
The metatag is used by (some) image software to 'correctly' rotate the image to portrait but ignored by other software which will display the image as landscape.
The situation is confusing and there is no established standard for this (the tags are just a hint), so when preparing images for an online publication the safest thing is to strip out these tags and physically rotate the image to the correct BITMAP orientation before uploading. If you are writing the server side of an app you could do this on the server. But it is vital to deliver images to a web browser in the correct BITMAP orientation with no orientation metatags.
Why is this? Because even today different browsers take different approaches to metatags.
The iPhone image I just mentioned displays as follows:
Google Chrome 24 portrait
Safari 6 portrait
Firefox 17 landscape
Opera 12 landscape
Not a great state of affairs!

Using Canvas to resize Iphone images before uploading to server

We are using Canvas to resize images on Iphone/IPAD before uploading to our server.
On IPhone 4S and 5, when photos are taken in landscape mode with FRONT camera, the resizing works fine. When taken in portrait mode, the images are squashed by about 1/4. But when taken with rear camera, all images, both landscape and portrait, are squashed by about 7/8, leaving just a thin belt to view.
On IPAD and IPOD, it is the same for front and rear camera: landscape images are fine, but portrait images are squashed by 1/4.
We tried several different resizing algorithms, but ended up with the same results.
Any ideas how to solve this problem?
I found a working solution for this. gokercebeci posted a great jQuery plugin on github. It is working as expected for my app!
Found a solution that works for me at HTML5 Canvas drawImage ratio bug iOS . The solution is accredited to stomita and posted and edited (I believe) by tombre and matt burns on 14 Jan 2014.

Resources