[SOLVED] auto thumb image from a blob problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
icelizard
Forum Newbie
Posts: 3
Joined: Mon Apr 17, 2006 9:22 am

[SOLVED] auto thumb image from a blob problem

Post by icelizard »

OK, i am having a problem, i have got lots of images stored on my database, and i want to display them, easy enough, but how would i auto thumbnail then?

I can thumnail images, and i can retrieve images from database but how would i do them together?!

to make that a bit more clear,

to thumbnail an image i would call thumb.php (img src = thumbnail.php?im=imagename.jpg)

to get image from database i call <img src="display.php?id=<? echo "$row[0]"; ?>">

but i just cant see a way round getting the image from the database then thumnailing it as calling from database is just getting the data from blob field then displaying it as an image. I have looked and looked for a solution with nu luck so far

Hope this explains it a bit better

Cheers for any help
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

look at the multitude of thumbnailing classes and functions we've got around this forum (search onion2k's posts)

Instead of using imagecreatefrompng() or similar, use imagecreatefromstring(). You should be warned that creating thumbnails on the fly (and not caching/storing them) will seriously slow down page responses and greatly increase CPU utilization and memory usage.
icelizard
Forum Newbie
Posts: 3
Joined: Mon Apr 17, 2006 9:22 am

Post by icelizard »

all i do to create the image is

<img src="display.php?id=<? echo "$row[0]"; ?>">

//display.php

Header( "Content-type: $type");
echo $data;

where $data = the blob field
icelizard
Forum Newbie
Posts: 3
Joined: Mon Apr 17, 2006 9:22 am

Post by icelizard »

i have resolved this problem now. thanks
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Why don't you post the solution so that others viewing the thread may benefit as well?
Post Reply