The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
generating real thumbnails on the fly
Has anyone worked out how to generate a real resized image thumbnail on the fly using PHP and the GD library? I can't find a hack for it.
In other words, not just displaying the image in a resized <img> tage, but displaying a real re-sized image? I can do it from an image FILE read directly from an images folder, but I can't work out how to pass the data from $attachment(filedata) to the ImageCreateFromJPEG ($imgfile) function. Just replacing $imgfile with $attachment(filedata) doesn't work of course. The top image in the left hand column at the following website is done from a file in a folder. http://www.screeneditors.com/forums/index.php the other images in the left hand column are just resized. Modem users complaining a bit ... is there a better way than saving the imagedata in a temp file then processing it? |
#2
|
||||
|
||||
You need to specify a filename and path, passing the data won't work. You can use the URL to the attachment and pass that:
PHP Code:
|
#3
|
||||
|
||||
Thank you Lee
But most of my images are in the MYSQL attachments database. How can I do the above transformation on them *without* exporting them to disk as files?? I'm think about installing the "attachments as files" hack but I don't want to unless I really need to. (Botley? I was brought up in Botley, Oxford! first time I've seen that name in 20 years!) |
#4
|
|||
|
|||
Quote:
|
#5
|
||||
|
||||
imagecreatefromstring() does it!
thanks for that pointer. but it seems REALLY slow ... is this normal? I mean, it seems slower than just loading the whole image! using basic code from PHP.net ... PHP Code:
|
#6
|
||||
|
||||
OK yep, its normal. Just read up a bit more on PHP.net.
So ... I think from now on I'll be generating thumbs on upload and store in database... |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|