You are here: Re: creating and presenting an image in php « PHP Programming Language « IT news, forums, messages
Re: creating and presenting an image in php

Posted by Erwin Moller on 01/30/07 16:39

Nick Wedd wrote:

> In message <45bf29dc$0$324$e4fe514c@news.xs4all.nl>, Erwin Moller
> <since_humans_read_this_I_am_spammed_too_much@spamyourself.com> writes
>>Excactly as you described it it could be done.
>>Just search for image (in the functionsearch) at www.php.net and you'll
>>find plenty examples.
>>http://nl2.php.net/manual/en/ref.image.php
>>Many imagefunctions have the possibility to safe the image to a path or
>>serve them directly to the browser.
>>If you run into problems, just come back here.
>
> I find that I can do all the image-processing stuff, e.g.
> <?php
> $im = imagecreatefrompng("i/sea.png");
> // many image-processing commands
> imagepng($im, "foo.png");
> ?>

Ok, good.

> <a href='foo.png'><img src='foo.png' width=80 height=60></a>
>
> What I still don't know is how to use a temporary file, that will go
> away when the user leaves the page, to store either the image or
> header+image.

Well, the overhead needed to store temp image files, and the
garbagecollection to find them and remove old ones, is probably not worth
your time.
Why not simply recreate it? Are you charged per CPU-cycle? ;-)

But if you want to do it you have several options, depending on what it is
excactly that you want to achieve.
Is each image you create unique for each visitor?
Do you want different visitor to be able to share images?
Or is your image ONLY valid when created as thumbnail, and then again as big
picture? Should some images be deleted, and others not? And what are the
rules?

You could think up some scheme where you store them in a directory, but if
nobody clicks through to the big picture, that directory will soon be
filled with nonsense images. You'll have to make some cronjob to clean that
up based on creationtime.

I would simply go with the doublecreation: your original plan. Clean and
simple.

Regards,
Erwin Moller


>
> Nick

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация