imagesx and imagesy???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Mr. Tech
Forum Contributor
Posts: 205
Joined: Tue Feb 11, 2003 4:18 pm
Location: Australia

imagesx and imagesy???

Post by Mr. Tech »

Hi!

I have an upload script and need to read the height and width of the image. I tried this but it doesn't seem to work:

Code: Select all

<?php
$im = $_FILES['file']['tmp_name'];

$width = imagesx($im);
$height = imagesy($im);
?>
And there example doesn't help either...

http://au.php.net/manual/en/function.imagesy.php
http://au.php.net/manual/en/function.imagesx.php

Anyone know how I can do it?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Have you tried getimagesize()?

Mac
Mr. Tech
Forum Contributor
Posts: 205
Joined: Tue Feb 11, 2003 4:18 pm
Location: Australia

Post by Mr. Tech »

No. Thanks, I'll give it a try!
Post Reply