ImageMagick Q

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
jonwondering
Forum Commoner
Posts: 39
Joined: Mon Mar 13, 2006 6:26 pm

ImageMagick Q

Post by jonwondering »

Is there any way to create a thumbnail on the fly without storing it as a file? What I can't figure out is not how to create a thumbnail with IM, but how to create it and display to the user without storing that new image as a file. Is it even possible with IM?

Thanks.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Yep, check out our Code Snippets
jonwondering
Forum Commoner
Posts: 39
Joined: Mon Mar 13, 2006 6:26 pm

Post by jonwondering »

If you mean that one, it's been removed :(

viewtopic.php?t=18814&highlight=imagemagick
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

It's possible alright .. but it's a really bad idea. Working with images is very intensive .. especially resampling them .. there's no good reason not to cache results to save CPU time.
jonwondering
Forum Commoner
Posts: 39
Joined: Mon Mar 13, 2006 6:26 pm

Post by jonwondering »

so will it take tons of cpu usage if it'll convert aprox 10 images width 760px, into thumbnails width 120px?

p.s.: i couldn't decide for a long time, what to save: cpu or memory... there's going to be lots and lots of images uploaded on the server.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Creating images on the fly without saving them greatly reduces the number of users you can have on the server at any given time and it will take longer to load any page that contains these images.
jonwondering
Forum Commoner
Posts: 39
Joined: Mon Mar 13, 2006 6:26 pm

Post by jonwondering »

alright, that makes sense. i guess i'd better go with memory usage instead of cpu. thanks for all your help hawleyjr, onion2k, and feyd.
Post Reply