Jump to content

Setting up a 'avatar' picture?


DarrenReeder

Recommended Posts

Hello, This is a question on how i can set up so if i have a image called 'pic.png' (for example)..how can i check the size of it (100pixels x 100pixels) for example..so i can make it so it will only display the image if its the correct size...

 

---

 

Also, if i made a link to a direct image cna i check the size of that..so this way i can just make it so it says 'Enter URL of your image' and it will save that url to the mysql

Link to comment
https://forums.phpfreaks.com/topic/188483-setting-up-a-avatar-picture/
Share on other sites

You can use either GD or Exif functions on an uploaded file. Exif should be better, because it requires to read the image header only, but it is not installed on some servers.

 

$data = exif_read_data('file.jpg', 'COMPUTED');
echo $data['COMPUTED.Width'];
echo $data['COMPUTED.Height'];

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.