# Resize a photo based on two points and its distance

**URL:** <https://forum.kirupa.com/t/resize-a-photo-based-on-two-points-and-its-distance/262599>\
**Category:** Uncategorized\
**Created:** [June 7, 2008, 3:14pm UTC](https://forum.kirupa.com/t/resize-a-photo-based-on-two-points-and-its-distance/262599 "2008-06-07T15:14:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![konach05](https://avatars.discourse-cdn.com/v4/letter/k/ea666f/32.png) [@konach05](https://forum.kirupa.com/u/konach05)\
**Post date:** [June 7, 2008, 3:14pm UTC](https://forum.kirupa.com/t/resize-a-photo-based-on-two-points-and-its-distance/262599/1 "2008-06-07T15:14:38Z")

</div>

Is it difficult to do it?

Assume the frame showing the photo to be 600X600 pixels  
When the user uploads a photo:  
1: he enter a value D (for example, D=7)  
2: He then point out two points (pt.A & pt.B)  
Assume the bottom left corner to be (0,0)  
3:The program then resize and rotate the photo such that,  
y-coordinate for both pt.A and pt.B to be 400 pixel  
x-coordinate for pt.A=300-8D=244 pixel  
x-coordinate for pt.B=300+8D=356 pixel  
4: The part outside the frame will be cut, and the image size becomes 600x600 pixels  
5: Save the photo

Is it difficult to do so?

Thank you

---

<div class="post-metadata">

**Author:** ![konach05](https://avatars.discourse-cdn.com/v4/letter/k/ea666f/32.png) [@konach05](https://forum.kirupa.com/u/konach05)\
**Post date:** [June 9, 2008, 7:44pm UTC](https://forum.kirupa.com/t/resize-a-photo-based-on-two-points-and-its-distance/262599/2 "2008-06-09T19:44:18Z")

</div>

> [@ahmednuaman;2339373](#):
>
> Not very, are you using GD?

thank you, this is part of the custom modification of a php website. I have no idea whether it is difficult to do so.
