Reproduce iPhone tricky image processing
Posted: 2011-10-11T01:10:18-07:00
Hello everyone,
First of all, I apologize if my english is poor. This is not my native language.
Here is my issue :
I have an iPhone application that allows user to play with a photo on a frame : translate, zoom, rotate.
Once the user validates its changes, the values of translation X, translation Y, zoom and rotation are sent to the server along with the original image.
For images where zoom < 1, I don't have any problem to make my server-side preview fit what I designed on the application.
But when zoom value is greater than 1.5, I'm starting having big big issues trying to reproduce the view.
Let's take a concrete example :
Step 1
I move my photo down and right :
Step 2
I zoom with my finger :
And that's it.
What I know is that zoom always take it's origin from the center of the photo (which is outside my original frame).
So the big picture is this :
What type of Imagemagick's trick can I use to achieve this result ? How can I have an enormous picture zoomed and crop just a frame in it, and having the result fitting perfectly my iphone preview ?
Maybe use a viewport, with resize and crop ?
Thanks a lot in advance for any kind of help.
First of all, I apologize if my english is poor. This is not my native language.
Here is my issue :
I have an iPhone application that allows user to play with a photo on a frame : translate, zoom, rotate.
Once the user validates its changes, the values of translation X, translation Y, zoom and rotation are sent to the server along with the original image.
For images where zoom < 1, I don't have any problem to make my server-side preview fit what I designed on the application.
But when zoom value is greater than 1.5, I'm starting having big big issues trying to reproduce the view.
Let's take a concrete example :
Step 1
I move my photo down and right :
Step 2
I zoom with my finger :
And that's it.
What I know is that zoom always take it's origin from the center of the photo (which is outside my original frame).
So the big picture is this :
What type of Imagemagick's trick can I use to achieve this result ? How can I have an enormous picture zoomed and crop just a frame in it, and having the result fitting perfectly my iphone preview ?
Maybe use a viewport, with resize and crop ?
Thanks a lot in advance for any kind of help.