MetroidMaster1914 Posted October 17, 2008 Share Posted October 17, 2008 So I'm trying to take an image, not knowing what the image sizes may be, and shrinking it if it's bigger than 100px to a max width/height of 100px. Here is my problem: The page always takes a long time to load when it comes to animated images. Sometimes it just gives up and stops loading the page. The page: http://www.metroidheadquarters.com/staff/ The code used to resize: <img src='<?php echo $avatar; ?>' <?php $imagesize = getimagesize($avatar); $width = $imagesize[0]; $height = $imagesize[1]; if ($width > $height){ if ($width > 100) { echo "width='100'"; } } else { if ($height > 100) { echo "height='100'"; } } ?> alt='<?php echo $name; ?>'> If you need more info, let me know. I'd appreciate any and all help in this matter. Link to comment https://forums.phpfreaks.com/topic/128894-image-resizing/ Share on other sites More sharing options...
alexweber15 Posted October 17, 2008 Share Posted October 17, 2008 try this: smart image-resize class Link to comment https://forums.phpfreaks.com/topic/128894-image-resizing/#findComment-668264 Share on other sites More sharing options...
MetroidMaster1914 Posted October 17, 2008 Author Share Posted October 17, 2008 thanks for the link. It says I need a GD library though. How can I find out if I have it on my server, and if it's not there, how can I put it there? Link to comment https://forums.phpfreaks.com/topic/128894-image-resizing/#findComment-668350 Share on other sites More sharing options...
alexweber15 Posted October 18, 2008 Share Posted October 18, 2008 thanks for the link. It says I need a GD library though. How can I find out if I have it on my server, and if it's not there, how can I put it there? if im not mistaken its usually installed by default just run the following phpscript on your server: <?php phpinfo(); ?> and search for "gd" you should find something like this: GD Support: enabled Link to comment https://forums.phpfreaks.com/topic/128894-image-resizing/#findComment-668429 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.