Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Show thumbnails for all images in a directory
Old 02-17-2009, 08:17 PM Show thumbnails for all images in a directory
Novice Talker

Posts: 12
Name: Andre Campbell
Trades: 0
Hi,

I have ALOT of images in a directory on my server. I was wondering if there is a way to make them all be shown as thumbnails so I can easily scan through all the images. Please help. I spent a while searching the internet and nothing...
__________________
Quality Hosting Solutions->
Please login or register to view this content. Registration is FREE

Showcase your site->
Please login or register to view this content. Registration is FREE


Last edited by thecubehost; 02-17-2009 at 08:20 PM..
thecubehost is offline
Reply With Quote
View Public Profile Visit thecubehost's homepage!
 
 
Register now for full access!
Old 02-18-2009, 01:35 AM Re: Show thumbnails for all images in a directory
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
It's pretty simple to go through all files in a directory, just have a look att php.net for the function opendir for a quick example, or search for "php list files in directory" on Google.

After that, you'd have to create a thumbnail for every image. Now, I dont know what you wanna do with them, but if you're going to be looking at them alot you may want to create a permanent thumbnail picture (save it in some directory). Otherwise, if you're only going to do this once, it may be enough to just set a width and height (with html or css) to the <img> tag and simply show all images that way.

If your going to create a thumbnail you're going to need some functions for that. You can find all image function in php here, http://se2.php.net/manual/en/book.image.php
But it's probably much simpler to search Google for "php make thumbnail", it's really not that hard
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 02-18-2009, 02:45 PM Re: Show thumbnails for all images in a directory
Novice Talker

Posts: 14
Name: Andy
Trades: 0
yes.. a little more detail will help to solve your problem.

look into this: http://webcheatsheet.com/php/create_...ail_images.php
1. The function will create a small thumbnail for each picture and put it in a different directory.
2. then in your CGI script, do something similar to this, replace $dir to the directory which contains your thumbnail image, and xxx to the webroot path to the image.
while (false !== ($fname = readdir( $dir ))) {
echo "<img src='/xxx/".$fname."'/>";
}
3. then your CGI will load all the image to your website. However, if you have A LOT of picture, it may be better to do some paging. For example, display 50 pictures at a time.
__________________
TextLinksDepot.com -
Please login or register to view this content. Registration is FREE
andylaubobby is offline
Reply With Quote
View Public Profile Visit andylaubobby's homepage!
 
Old 02-18-2009, 08:37 PM Re: Show thumbnails for all images in a directory
Novice Talker

Posts: 12
Name: Andre Campbell
Trades: 0
There are over a hundred images in the directory. And making the thumbnails seems tricky.

Is it possible to find a script that will just shrink ALL the images in a directory like highslide? The problem will highslide is that you have to have a direct link to all the images.
http://highslide.com/
__________________
Quality Hosting Solutions->
Please login or register to view this content. Registration is FREE

Showcase your site->
Please login or register to view this content. Registration is FREE

thecubehost is offline
Reply With Quote
View Public Profile Visit thecubehost's homepage!
 
Old 02-19-2009, 12:00 AM Re: Show thumbnails for all images in a directory
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Highslide doesn't shrink images for you, it only opens them in a flashy way. You must already have a thumbnail and then make it a link to the full size picture.

And still, as I said before, it really isn't that hard, I promise
For example, check this out. http://www.webcheatsheet.com/php/cre...ail_images.php
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 02-19-2009, 07:43 PM Re: Show thumbnails for all images in a directory
Novice Talker

Posts: 12
Name: Andre Campbell
Trades: 0
Hi. Thanks for the reply. However, it will be too much work to
make links from thumbnails to all those images. There are over a
hundred in the directory. I just wanna be able to do a quick scan
through the directory so I can know which pictures to keep.

If I make links, the time to make all those links will probably be longer than the scan if you know what I mean...
__________________
Quality Hosting Solutions->
Please login or register to view this content. Registration is FREE

Showcase your site->
Please login or register to view this content. Registration is FREE

thecubehost is offline
Reply With Quote
View Public Profile Visit thecubehost's homepage!
 
Reply     « Reply to Show thumbnails for all images in a directory
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31095 seconds with 12 queries