Cropping, Zooming, and Rotating uploaded images using Flash and php and then saving the manipulated image.

How do you take an uploaded image (we are uploading using Php script) that is loaded into a flash movie and save a manipulated version of that image that was cropped, rotated, and/or zoomed in or out (user has control of manipulation) to the server?

In a more detailed version of that question we are trying to allow people to upload images on our website (we have this done).

Once the image is uploaded it is loaded into a flash movie (we can figure this out as well)

Then the user uses a flash movie to crop, rotate, and zoom in or out of the image. Once they have selected how they want to manipulate the image we need to be able to save that to the server. A good example of what we are trying to accomplish is found at (click launch demo to view the example) They are uploading images into flash and cropping, rotating, and zooming. The big question is how are they then saving the image?

Do you pass variables to php from flash to crop, rotate, and zoom to get a final image? If so what are the commands to do so?
Do you manipulate the image within flash and then have the flash movie save to the server the manipulated image?

Or is it something totally different?

Any help would be greatly appreciated!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David BruggeCommented:
What will be done with the image once it has been manipulated on screen? If the image is static and the resolution is the same as appears on screen, I would think that a simple screen grab might me a possible solution.

If the screen image is only a representation such as was shown in the demo i.e. Uploading a 800px x 500px causes a 250 x 150 image to appear on screen. The implication is that you are going to order a card that uses the full resolution of the original to print the card.
If this is the case, it is similar to the way we used to work on huge graphics files back in the dark ages.

It would take thirty minutes to an hour to rotate a big file and do a screen redraw. And then you might not like the results and want to change it back. Or maybe you rotated too much and had to adjust.

We would down sample the image severely and manipulate that. We could flip, rotate, skew, etc. We just had to keep a log of the changes. (Flash can do this pretty nicely I should think, without a log) We then used the final settings from the log to manipulate the large image. We would plug in our settings and let the image crank overnight.

Something similar might be employed. (but without the waiting, but with post processing)

The demo had three variables. Zoom, rotation (in increments of 90 degrees) and X Y placement. It would be fairly straight forward to save those setting and apply them to the uploaded image.
mblymanAuthor Commented:

You are correct in thinking that the uploaded image is basically going to be resampled to a smaller size and manipulated in the flash movie. To answer your question about what happens after manipulation is that we want to be able to take the variables from the end user and manipulate the full quality graphic and then save that manipulated image on the server to be printed with an order.

I like your idea of having flash pass out the variables of what needs to be done to the image. Two questions still remain unanswered. 1) what  do we use to manipulate the image based on the variables passed out of flash. We are anticipating hundreds of these every day and want to have an automated process that creates these manipulated images.

2) Because we are going to have large quantities of photo maipulations occuring what are the processing times and server loads involved with doing this. You mentioned that it use to take 30 minutes to manipulate graphics. If we do hundreds or even thousands a day what is the load going to be on our server.
David BruggeCommented:
The time constraints on a single image are not a problem. We were working on files in the 500 to 600 MB range. You won't get any of those uploaded on the internet. (grin!)

I would say Photoshop would be your best bet. You can program a script using java or Visual Basic that will read a database and apply the parimiters and save a copy. You might have to get several programs running depending on the load, but my guess that working on a typical size uploaded file, a fast machine can just about run even with your prints. (I'm thinking just a few minutes per image) You might also have to have a quality control inspector lwatching thumbnails for exceptions before they reach the print stage.
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

mblymanAuthor Commented:
I've heard of people using image magick to manipulate images from a server based level. Any thoughts? Also we are thinking of using the same server that is running our websites to do the image processing. If we used something like image magick to manipulate images would it take a few minutes of processing to do each one? We are thinking contraining upload size to under 3 MB per picture and have a min px width of at least 400 px.
David BruggeCommented:
Yes, I think Imagemagik would be a great application. I didn't mention it because not that many people are aware of it and it tends to be intimidating. I have not done more than dabble with it, but I have friends that swear by it.
What resolution do you print at? If you are limiting file size to 3M, and width to 400 pix, that would leave a height of 1200 pixels before you reach the 3M size (with 16bit RGB images)
If you are outputting at say 150 dpi, your 400 pixel limit will make images just 2 and a quarter inches wide.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mblymanAuthor Commented:
We are going to be printing closer to 300 dpi and we only need images that are around 1.5" square so we don't need very large images. We started working with image magick today and things look good. We have read that using imagemagick with php code slows down the processing and efficiency of the processing. Any thoughts on ways around this or insight on the command lines we could use in image magick?

David BruggeCommented:
Sorry, I don't have enough experience myself to give you solid advice on that. Like I said, I've only dabbled with ImageMagic a little, and I've been out of the printing part of the industry for several years. You might post a question with ImageMagick in the header and see if it gets some hits.
Good luck!
mblymanAuthor Commented:
Thanks I'll do that if need.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Graphics Software

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.