Jump to content

Archived

This topic is now archived and is closed to further replies.

wwfc_barmy_army

PHP Thumbnail

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.

Share this post


Link to post
Share on other sites
wats the code in the phpTumb.php file. that could give us some idea.

Share this post


Link to post
Share on other sites
For some reason it's not letting us post it, if you download it from here:
http://sourceforge.net/project/showfiles.php?group_id=106407&package_id=114543

You can then see the code.

Thanks.

Peter.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
I've been trying different things for a last hour but still no luck. Does anyone else have any advice about this?

simcoweb, let me know if you figure anything out :)

Pete.

Share this post


Link to post
Share on other sites
Yes, after a lot of messing with it i finally got it to work. Turns out that it was looking the the wrong place so thats why it was a broken image, but after changing come code here and there i have solved it :)

Pete.

Share this post


Link to post
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 ;)

Share this post


Link to post
Share on other sites
Toon, I emailed you on that offer. Let me know if you get it. Thanks!

Share this post


Link to post
Share on other sites
Toon, I emailed you some questions. Having a bit of a challenge getting the class file and function set up properly. The upload is failing in the final stages. Just needs some tweaking on my coding i'm sure.

Share this post


Link to post
Share on other sites

×

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.