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
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'];

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.