# Problem Solving, More Math than AS3

**URL:** <https://forum.kirupa.com/t/problem-solving-more-math-than-as3/296118>\
**Category:** flash\
**Created:** [September 9, 2009, 7:19pm UTC](https://forum.kirupa.com/t/problem-solving-more-math-than-as3/296118 "2009-09-09T19:19:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anakadote](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/anakadote/32/2119_2.png) [@anakadote](https://forum.kirupa.com/u/anakadote)\
**Post date:** [September 9, 2009, 7:19pm UTC](https://forum.kirupa.com/t/problem-solving-more-math-than-as3/296118/1 "2009-09-09T19:19:33Z")

</div>

I’m developing an application in AS3 that loads in a scaled image (resolution and dimensions scaled down), manipulates it (zoom/rotate) and then sends the info back to PHP to make the changes to the original image. The problem I’ve been having for hours now is figuring out how to translate the changes made in the Flash application to the full-scale image.

Original Image  
1500px x 2100px @ 300ppi

Scaled and Sent to Flash App  
450px x 630px @ 72ppi

Scaled Down in Flash App  
400px x 560px, still @ 72ppi

Now, when I send the 400px x 560px back to PHP, how do I translate that change to the original image? It’s not as simple as reducing the original image by the same percentage as the scaled image was reduced in the Flash App.

This is what I have so far, but the new dimensions always come out too small:

scale\_difference = orig\_img\_resolution/72; // 300/72  
scale\_change = img\_width\_from\_app/orig\_img\_width; // Scale change  
new\_width = orig\_img\_width\* (scale\_change_scale\_difference);  
new\_height = orig\_img\_height_ (scale\_change\*scale\_difference);
