suess0r Posted February 1, 2007 Share Posted February 1, 2007 I'm looking for the best way I should go about this issue... I have 500+ images in my web folder /images/clubs of all different sizes. I am currently calling them like this with a specific width/height... <img src="/images/clubs/logos/'.$id.'.jpg" align="center" width="300" height="128"> and thumbnails like this... <img src="/images/clubs/logos/'.$id.'.jpg" align="center" width="120" height="55"> The problem is that they are loading really slowly and practically crawling on the screen. I realize that it can lag down by resizing all the images, etc. but i was wondering the following... if either A.) There was a better way to call these images to expedite the process? or B.) If there was a way I can go and resize all the images to approx those sizes. Another issue is that some of the images are tall & skinny and some are normal and some are wide. Anyway, just wondering how people generally get around this issue. Link to comment https://forums.phpfreaks.com/topic/36700-image-size-scaling-problem/ Share on other sites More sharing options...
janroald Posted February 1, 2007 Share Posted February 1, 2007 You can check for a thumbnail version of the image, "..._thumb.jpg" or whatever you call your thumbnails, or else create a thumbnail using typically imagemagick/convert on most linux servers or maybe gd library in windows(usually not a default package). http://no2.php.net/manual/en/function.getimagesize.php This function in php can help you to decide what ratio etc. u should use when displaying the pictures, and lots of other helpfull stuff. Now get on reading :-) Link to comment https://forums.phpfreaks.com/topic/36700-image-size-scaling-problem/#findComment-175052 Share on other sites More sharing options...
corbin Posted February 1, 2007 Share Posted February 1, 2007 The reason that the page is loading slow is most likely due to large image sizes or a slow upload speed on the server, not because of the HTML resizing. Like fore-mentioned I suggest looking into the GD library and dynamically generating thumbnails. I suggest only creating the thumbnail if it doesn't exist though... That way it doesn't take as much CPU and memory on every page view. Link to comment https://forums.phpfreaks.com/topic/36700-image-size-scaling-problem/#findComment-175074 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.