TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Image resize (http://www.talkphp.com/general/2544-image-resize.html)

TlcAndres 03-29-2008 12:35 AM

Image resize
 
Well I'm working on a gallery for a client and he specifically stated he wanted the full images download and then resized to thumbnails. I was wondering how'd y'all would do it.

I though up the following two methods

Method 1: Use javascript to fetch the images width/height set the image elements and then set the src.

Method 2: use getimagesize() and set the height/width elements beforehand.

Rendair 03-29-2008 12:45 AM

I have a solution. Maybe instead of actually creating a thumbnail that is saved. You can use the large image.

If you check out my thumbnail class here. http://www.talkphp.com/advanced-php-...using-php.html

You can use this to create the thumbnail of that large image without it actually saving it to your server.

You can just use something like this
PHP Code:

<img src="thumbcreate.php?src=images/largimg.jpg"//link to large image 


maZtah 03-29-2008 10:41 AM

What I usually do is:
  1. The user uploads a picture to the server (with my CMS)
  2. CMS creates a thumbnail from original picture (GD library)
  3. Save both pictures (original and thumb) on the server
  4. Put all picture information in the database (like the new width and height of the thumbnail)
  5. Now for the gallery: read out the image table from the database and show the thumbnails - with their widths/heights - on the page!

Hope this is any helpful.


All times are GMT. The time now is 06:21 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0