DarrenReeder Posted January 14, 2010 Share Posted January 14, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/188483-setting-up-a-avatar-picture/ Share on other sites More sharing options...
Zyx Posted January 14, 2010 Share Posted January 14, 2010 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']; Quote Link to comment https://forums.phpfreaks.com/topic/188483-setting-up-a-avatar-picture/#findComment-995058 Share on other sites More sharing options...
ignace Posted January 14, 2010 Share Posted January 14, 2010 Take a look at getimagesize and filesize Quote Link to comment https://forums.phpfreaks.com/topic/188483-setting-up-a-avatar-picture/#findComment-995060 Share on other sites More sharing options...
harkly Posted January 14, 2010 Share Posted January 14, 2010 http://lmgtfy.com/?q=php+check+image+size Quote Link to comment https://forums.phpfreaks.com/topic/188483-setting-up-a-avatar-picture/#findComment-995061 Share on other sites More sharing options...
DarrenReeder Posted January 14, 2010 Author Share Posted January 14, 2010 which is recommended? Exif or Checkimagesize ? Quote Link to comment https://forums.phpfreaks.com/topic/188483-setting-up-a-avatar-picture/#findComment-995062 Share on other sites More sharing options...
ignace Posted January 14, 2010 Share Posted January 14, 2010 which is recommended? Exif or Checkimagesize ? 1 exif if supported, 2 gd if supported and not jpeg or tiff, 3 getimagesize otherwise Quote Link to comment https://forums.phpfreaks.com/topic/188483-setting-up-a-avatar-picture/#findComment-995093 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.