HTML5 Canvas Graphics and Animation - ios

We are build a HTML 5 website. One feature is to use 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 thoughts on how to solve this problem?

Related

iOS coordinates for iPad and iPhone game using spritekit

I am trying to make a game using sprite kit that works on both iPhone and iPad.
For iPhones I can set the scene size to 320x568 and scale it for all resolutions it works fine.
For iPads too this works fine. But as the point resolution on iPad is 768x1024 I can see scaling artifacts and also images are not sharp.
So I want to set the scene size to 768x1024 for iPads. Most of my game images are drawn using sprite kit instead of loading images. So when I set the new scene size the images look smaller.
What would be the best way to specify the correct dimensions for the images while drawing it? Would I have to convert each and every dimensions and points used based on the device type?
You can draw your images using the largest screen size and scale them down to fit smaller screen sizes. This works well if the aspect ratio is the same for devices like iPhone 5, 6 and 6+. You do have to create separate images and/or screen layouts for the iPad and iPhone 4 which have a different aspect ratio.

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 to set up the video size so that it works on all ios devices without black bars

I'm just wondering what size the video should be so that there won't be black bars on iphone 4/5 or ipad? Any suggestion will be appreciated. Thanks!
Since the iPhone 4, iPhone 5, and iPad all have different screen aspect ratios it's impossible to have a single size of video which in full-screen mode won't have black bars on some devices.
Instead, you can use the scalingMode property of MPMoviePlayerController to keep your video zoomed in to fit the screen (assuming that's what you're using to play back your video - similar analogues exist in other video playback classes). You probably want to use the MPMovieScalingModeAspectFill scaling mode, which will fill the video to fit the screen without distorting it.

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.

ipad 1 video mirroring full screen

Im mirroring my app on a tv, using this post about video mirroring for iPad, in an iPad1
the problem is that the image is not full screen,
how can i make the image full screen?
thanks!
The image most likely isn't scaled correctly because your iPad's aspect ratio is 4:3 whereas your TV (if HD) is most likely 16:9.

Resources