Re: question about web-based images

  • From: Octavian Râsnita <orasnita@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Sun, 5 Apr 2009 22:39:58 +0300

From: "Alex Hall" <mehgcap@xxxxxxx>
I am supposed to write a web-based way to upload pictures to a site, divided into albums. I have a few questions before I start this, and keep in mind I am doing it for free: 1. Many sites, like Kodak.com or Flickr.com, have a setup where mini pictures, like large thumbnails, are shown on the page. Can the server resize images from the originals to show those mini images? If so, how (what language is best, I know more php than any other).

Yes it is possible, although I don't know how to do it with PHP. PHP should be able to do this for sure. PHP has support for GD and I think you can use the GD library to create the thumbnails.

2. Is there an easy way to link to the large images from the small ones? Depending on the answer to the first question, is this just a link to another image or is it a call to a resize function of some kind?

Of course you can just resize using HTML element attributes, but it is not recommended because you would force the user to download big images just for viewing a small thumbnail, so the best way would be to create another set of small images and show links like:

<a href="big_image.png"><img src="small_image.png" alt="..." /></a>


3. Is there a wa of securing the page? I have worked with php's $_SESSION vars, but have not quite gotten it to work very well.

Yes of course you can. I think you may find some tutorials about how to do authentication with PHP.

Octavian

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: