TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-29-2008, 12:35 AM   #1 (permalink)
The Addict
 
Join Date: Nov 2007
Posts: 264
Thanks: 2
TlcAndres is on a distinguished road
Default 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.
__________________
"What everyone seems to forget is that while knowledge certainly is something - it's the implementation of knowledge that brings power" - Andres Galindo.
TlcAndres is offline  
Reply With Quote
Old 03-29-2008, 12:45 AM   #2 (permalink)
The Addict
Upcoming Programmer Top Contributor 
 
Rendair's Avatar
 
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
Rendair is on a distinguished road
Default

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. Cropping Images using PHP

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 
__________________
www.jooney.co.uk - the online portfolio
Send a message via MSN to Rendair
Rendair is offline  
Reply With Quote
Old 03-29-2008, 10:41 AM   #3 (permalink)
The Acquainted
 
Join Date: Oct 2007
Posts: 170
Thanks: 18
maZtah is an unknown quantity at this point
Default

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.
maZtah is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:36 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design