Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graphics on the fly

Status
Not open for further replies.

DaRNCaT

Technical User
Joined
Dec 18, 2002
Messages
566
Location
NZ
I have a client who is insisting on being able to upload images, and resize them on the fly- for an image gallery.
I have never used any of the image stuff like GD, and have no idea where to start with this, or even if it is available on the server I host with.
If someone could point me in the right direction as to which package works the best, and what kind of server load it is going to cause, as well as if the images are perminatly resized, instead of resizing everytime they are called.
Also, if I call up phpinfo, will I be able to see if any of the packages are available, or do I have to check somewhere else?
thanks.


Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
first: when you call phpinfo() you see all packages that are installed on the server.

second: i use GD2 because it brings a greater support for working with graphics. the load on the server depends on what you want to do with the graphic library. about resizing, it depends on how you do it (you could resize the images when they are uploaded and create thumbnails for them which are saved on the server's disk and then used directly like that - shrinked - or you could resize them every time they need to be displayed - which means that the server load increases)
 
If you're going to manipulate images on-the-fly using PHP, you must use GD.

Have you looked at Gallery? It's a pretty good system which uses the GD library from PHP.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thanks,
I've discovered I have a bundled version of GD with the php on the server, (2.0.23 compatible).
Having looked at what my client wants to upload, and his quite considerable lack of computer knowledge, I want to be able to resize the pictures as they get uploaded, and thumbnail them, so there is no "on the fly" resizing.
(He sent me an email insisting that 72 dpi wasn't enough for the images, and I'd have to make them look better, I can't seem to make him realise that screen resolution IS 72dpi, and larger dpi will just make the image load slower, and be printable quality- which he doesn't want, as he doesn't want his artwork stolen, I fear he will try and upload 300+ dpi pictures)

I've looked at an online manual, by the creators of GD, but I really need a tutorial or example to work from, as I'm not very good at nutting out manual examples.


I don't want to use a prebuilt gallery, but I'll need to upload, resize twice, save each resize in a different place (ie, /images, and /thumbnails folders).
Is there some way in doing this I can ensure the jpg image is 72 dpi (or small enough file size) once it's resized?

If anyone knows of some good tutorials, or can explain in easy to follow methodology what to do (I'm not a programmer, but I'm learning)
thanks.

Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
Just a side note, but GD allows you to "watermark" all images uploaded, so theres no worry about image theft with a logo splattered over them in an opaque mask.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top