Jump to content


Photo

PHP Thumbnail


  • Please log in to reply
8 replies to this topic

#1 wwfc_barmy_army

wwfc_barmy_army
  • Members
  • PipPipPip
  • Advanced Member
  • 320 posts

Posted 03 October 2006 - 11:49 AM

Hello.

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

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

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

Any ideas where i am going wrong?

Thanks.

Peter.

#2 JasonLewis

JasonLewis
  • Members
  • PipPipPip
  • Advanced Member
  • 3,351 posts
  • LocationVictoria, Australia

Posted 03 October 2006 - 11:52 AM

wats the code in the phpTumb.php file. that could give us some idea.
Good luck with your coding.
Jason / ProjectFear / Jaysonic

#3 wwfc_barmy_army

wwfc_barmy_army
  • Members
  • PipPipPip
  • Advanced Member
  • 320 posts

Posted 03 October 2006 - 03:58 PM

For some reason it's not letting us post it, if you download it from here:
http://sourceforge.n...ckage_id=114543

You can then see the code.

Thanks.

Peter.

#4 simcoweb

simcoweb
  • Members
  • PipPipPip
  • Advanced Member
  • 1,102 posts
  • LocationCA

Posted 04 October 2006 - 03:14 AM

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.

#5 wwfc_barmy_army

wwfc_barmy_army
  • Members
  • PipPipPip
  • Advanced Member
  • 320 posts

Posted 04 October 2006 - 11:58 AM

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.

#6 wwfc_barmy_army

wwfc_barmy_army
  • Members
  • PipPipPip
  • Advanced Member
  • 320 posts

Posted 04 October 2006 - 12:06 PM

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.

#7 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 04 October 2006 - 12:15 PM

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 ;)
follow me on twitter @PHPsycho

#8 simcoweb

simcoweb
  • Members
  • PipPipPip
  • Advanced Member
  • 1,102 posts
  • LocationCA

Posted 04 October 2006 - 04:38 PM

Toon, I emailed you on that offer. Let me know if you get it. Thanks!

#9 simcoweb

simcoweb
  • Members
  • PipPipPip
  • Advanced Member
  • 1,102 posts
  • LocationCA

Posted 05 October 2006 - 09:49 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users