Jump to content

PHP Thumbnail


wwfc_barmy_army

Recommended Posts

Hello.

I'm looking to use phpthumb (http://phpthumb.sourceforge.net/) make a thumbnail of images from a database, so i have this code:
[code=php:0]<?php print "<img src=phpthumb/phpThumb.php?src=" . $qry[screenshot]. "&w=200>"; ?>[/code]

And when looking at the site it shows:
[code]http://localhost/rpg/phpthumb/phpThumb.php?src=images/screenshots/image.jpg&w=200[/code]

But it comes up as a broken image :( The image works fine here:
[code]http://localhost/rpg/images/screenshots/image.jpg[/code]

Any ideas where i am going wrong?

Thanks.

Peter.
Link to comment
Share on other sites

I'm very interested in this thread cuz i'm also looking to generate thumbnails on the fly and haven't gotten any responses to my other posts concerning this topic. I downloaded the phpThumb() files and can either post it or upload as an attachment if the forums allow.

Like you, Peter, I need the <img src to produce an image from a query instead of having the name of a specific image in the <img src tag.

I haven't fully set up the phpThumb yet but noticed the demo has a ton of broken links for the images. No images came in my download file. That's a red flag. Hope this isn't a waste of time.
Link to comment
Share on other sites

The method you are adopting is for generating images that are stored directly in a database table - in a BLOB field.

If the images are actually stored in a directory on your server then u don't need to use the src="ascript.php" method.....

I personally use a file upload class that will create a thumbnail when the file is uploaded - Ithink it is the best way to reduce the amount of prcessing the server has to do - why create a thumbnail each time it is called? just do it once.

for those intersted e-mail me and I will send you my upload class and associated code - free of charge! just give me all the glory ;)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.