cooldude832 Posted July 18, 2007 Share Posted July 18, 2007 I'm generating a dynamic map off mysql and it will be a sort of 10x10 grid that is composed of different images (like grass, trees, sand, mountains, lake etc etc) My question is would it be better to use the gd library to generate each map look (it changes on every page load) using GD to link each of the smaller images (48x40 pngs) to 1 big (480x400) png and then only displaying that one image. Or would it be better to just query out and display them straight from the query doing it 100 times (10 by 10 grid) showing 100 images. Link to comment https://forums.phpfreaks.com/topic/60479-whats-faster-1-big-image-or-lots-of-small-using-gd/ Share on other sites More sharing options...
pocobueno1388 Posted July 18, 2007 Share Posted July 18, 2007 Well...100 queries is a lot, especially if this page is going to be viewed a lot, so I would try to avoid that route if possible. If you can make it happen with the GD library, then I say go with that. Link to comment https://forums.phpfreaks.com/topic/60479-whats-faster-1-big-image-or-lots-of-small-using-gd/#findComment-300861 Share on other sites More sharing options...
cooldude832 Posted July 18, 2007 Author Share Posted July 18, 2007 its not 100 queries the query is the same in both case $q = "select x,y,type from `map` where x>=$minx && $x <=$maxx && y>=$miny && y<$maxy"; but then after it is queried it has a while loop while ($row = mysql_fetch_assoc($result){ Options here. I can paste together the whole map if i sort my query by Y then X and then simply "grow" the big image out or i can do a multi array $map[]['x] = $row['x']; $map[]['y'] = $row['y']; $map[]['type'] = $row['type']; and then echo it out as a table later down? First version would require lots of GD, (but could be done via na extenral file, the second requires no GD but spalshes out 100 images and must echo out a 10x10 table. Link to comment https://forums.phpfreaks.com/topic/60479-whats-faster-1-big-image-or-lots-of-small-using-gd/#findComment-300876 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.