: Gryffyn, Trevor
> Cc: 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 so
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.
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 mail
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
=
---
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 th
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) / 2
6 matches
Mail list logo