[PHP] Advanced maths help (for GD image functionality)

2004-10-15 Thread Mag
Hi! I need someone who is very good with maths to help me with this, unfortunatly I suck at maths so that someone can not be me. Ironically before I started my first computer course years back I asked the instructer if learning computers needed a lot of maths...she said 'no, just basics'..that

Re: [PHP] Advanced maths help (for GD image functionality)

2004-10-15 Thread Chris Dowell
Problem 1) $h_1 = 600; $w_1 = 800; $h_2 = 120; $w_2 = $w_1 * ($h_2 / $h_1); Problem 2 a) Assuming you're wanting the central portion of the original image (which I think you are from what you've written) $h_1 = 600; $w_1 = 800; $h_2 = 120; $w_2 = 90; $x = ($h_1 - $h_2) / 2; $y = ($w_1 - $w_2) /

RE: [PHP] Advanced maths help (for GD image functionality)

2004-10-15 Thread Gryffyn, Trevor
Good questions.. Here's some stuff to play with: Heres my maths problems in 2 parts: Problem 1) I need to scale down an image (eg: example.jpg) to height of 120 pixels while maintaining the images proportions. eg: if i have an image of (height and width) 800x600 what would the

RE: [PHP] Advanced maths help (for GD image functionality)

2004-10-15 Thread Mag
DAMN! 2 minutes after posting to the list I get some pretty good mails from two people with answers on how to solve this,while i had a restless night trying to figure this out in my head! I LOVE THIS LIST! Thanks guys, will tell you how this goes and if i have any problems. Cheers, Mag =

Re: [PHP] Advanced maths help (for GD image functionality)

2004-10-15 Thread Pankaj Kafley
Very helpful indeed. Until today I had used softwares like Photoshop to get the exact proportion rate. This really works, thank you guys. Cheers !!! On Fri, 15 Oct 2004 07:05:34 -0700 (PDT), Mag [EMAIL PROTECTED] wrote: DAMN! 2 minutes after posting to the list I get some pretty good mails

Re: [PHP] Advanced maths help (for GD image functionality)

2004-10-15 Thread Jonel Rienton
it's algebra at work :) nicely done. On Oct 15, 2004, at 8:57 AM, Gryffyn, Trevor wrote: Good questions.. Here's some stuff to play with: Heres my maths problems in 2 parts: Problem 1) I need to scale down an image (eg: example.jpg) to height of 120 pixels while maintaining the images proportions.

RE: [PHP] Advanced maths help (for GD image functionality)

2004-10-15 Thread Gryffyn, Trevor
: php php; Mag Subject: Re: [PHP] Advanced maths help (for GD image functionality) it's algebra at work :) nicely done. On Oct 15, 2004, at 8:57 AM, Gryffyn, Trevor wrote: Good questions.. Here's some stuff to play with: Heres my maths problems in 2 parts: Problem 1) I need