graham23s Posted November 15, 2007 Share Posted November 15, 2007 Hi Guys, what im trying to do is get random inages from mysql and display them in like a "random profile" box, but i was trying to keep them all roughly the same size, so basically grab them from mysql and: <img src="images/image1.jp2" height="$height" width="$width"> so basically it just displays them in the correct ration WITHOUT saving them is this possible at all? thanks guys Graham Quote Link to comment Share on other sites More sharing options...
s0c0 Posted November 15, 2007 Share Posted November 15, 2007 I do this on my server, but since its my server I just use image magick's convert command. My code looks like this: function imgResize($img) { exec('convert -size 125x125 '.$img.' -resize 125x125 '.$img); return true; } Where image is the full path to the file. Quote Link to comment Share on other sites More sharing options...
graham23s Posted November 15, 2007 Author Share Posted November 15, 2007 Hi Mate, that worked a treat, is magick better/worse than GD can you also save resized images with it? cheers Graham Quote Link to comment Share on other sites More sharing options...
s0c0 Posted November 15, 2007 Share Posted November 15, 2007 I wouldn't be the right person to ask if it is better or worse, but its obviously easier and there aren't really any downsides. The portion after the -resize argument is where you are telling the command to save the file. In the example I gave, I am just over writing the existing file. Quote Link to comment 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.