AV1611 Posted October 11, 2008 Share Posted October 11, 2008 I have a site that pulls forum data via sql and based on various conditions, places it on another site. The site is working good, and I've been able to create filters like converting (some) bbcode back to html, etc... Anyways, What I want to do, and I don't know where to begin, is when the data string has something like this: $str = 'blah blah blah blah <img src="somepic.png" alt=''whatever" />'; is I want to somehow "thumbnail" that pic before it shows up on the site. I DON'T want to change it on the forum site... Dunno if this is a GD thing or whatever... I tried putting: img{ width: 200px; } in the css, but it makes pic's that are smaller than 200px bigger, which is a problem, but it did seem to fix the ones that were bigger than 200px though... Help? Quote Link to comment Share on other sites More sharing options...
zq29 Posted October 12, 2008 Share Posted October 12, 2008 A number of options here. You could stick with your styling method you used above, but improve it by checking the dimensions of the image first with getimagesize() Build a scaled version of the image with the GDLib functions, I believe you can reference remote files as your source with imagecreatefromjpeg() - Check the manual for rescaling, a couple of people have posted up scripts in the comments if you can't figure it out. 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.