Hi, I recently just started a website on this server and i was wonder if anyone could answer what maybe a pretty simple question. My coding is a bit rusty for I havent written a page since college about 2-3 years ago.
I am going to have a website that posts funny pictures over several pages which will grow and grow over time.
I was wondering if there was a way to show a thumbnail of the picture without actually having to create a separate thumbnail file... I do not remember ever using this when I coded but since that was a while ago I was wondering if there is a way to do it now..
and if there is a way to show the thumbnails in order over as many pages as it takes to show all of them.
If someone could please get back to me with any input it would be greatly appreciated..
For now I am just excited to have my access to this site finally.
yey!
thanks for your time,
Duder673
mathiaus: edited yeh!
use the width and height attributes.
| Code: |
| <img src="image.gif" width="100" height="100" alt=image .> |
Or CSS
| Code: |
| <img src="image.gif" style="width: 100px; height: 100px;" alt="image" /> |
Though of course it doesn't change the file sizes so if the image are large it would take a while for them to load for people with dile and they would take up more bandwidth so using separate thumbnail images is better.
Ok i was wondering how to just make the files a certain percentage of the size that they already are.... like say 20-30%
And the other thing is....
How do i get them to be listed sequentially over more than one page..
Is there a way that I can increment the size name by +1 every time?
My filenames are all simply numbers. "0000000.jpg", "0000001.jpg" etc...
I was wondering if there was a way that I can have the site list the new pictures on the first, 2nd, 3rd page whenever they are updated
All of my pics are in one folder and I want the index.html file to read that directory and list all the files 20 per page starting for the last file within that directory which will be the largest number of course.
If anyone could help me out with this code it again will be greatly appreciated.
Thank you for your time,
Duder673
Always use seperate images for thumbnails. There are 2 reasons:
1. As 'The Conspirator' said, the size thing and
2. When you reduce the size by HTML/CSS techniques results are not as smooth as when done by the graphics app like photoshop. Photoshop reduces the size smoothly, whereas size reduction through these technique looks pretty blocky.
Ok, if I have to make thumbs then does anyone know of a
good free multiple thumbnail generator that could make a whole folder of jpg and gif files into thumbnails with the same filenames with one letter changed in the filename to show that it is a thumbnail?
for instance create all of the pictures that I have into thumbnails...
Say I have files named 0000001.jpg through 000000250.jpg
How could I create them all into thumbnails 30% of the size of the regular files and have them renamed with a "t" on the end of the files
Example: 0000001t.jpg through 000000250t.jpg
-Duder673
I like http://phpthumb.sourceforge.net - a PHP-based thumbnail generator. It does a great job. I use it two ways:- By adapting one of the demo PHPs to recurse through the directories where I have all the images stored and generate thumbnails for images that don't already have them;
- By putting a call to the thumbnail generator in the PHP that accepts image uploads so that any newly uploaded images will automatically have a thumbnail generated
The way I have it set up (this is for a real-estate site I designed that is not related to anything on Frihost), each listing has its own directory, and each of those directories contain separate "thumbs" directories. That way, the thumbnails can have filenames identical to the names of the original images.
It is better to use photoshop. As it does better interpolation and gives smoother effects. To do it conviniently:
Step 1. Move all your images to a folder. Let's say the folder is 'pics'.
Step 2. Create a action in Photoshop which reduces the current image to 30% of it's size. If you're feeling lazy, I've made the action for you. Download it here: http://tritium.frihost.net/dataf/Thumbnail.atn
Step 3. Load it from your actions panel.
Step 4. Go to File>Automate>Batch.
Step 5. From there select the Set as 'Thumbnails' and the Action as 'Thumbnails'(if you're using my actions, for ur actions do as appropriate).
Step 6. Select the source as Folder. Click on 'Choose' and select the folder called 'pics' or wherever you've stored the images.
Step 7. Check all the following options in the dialog except 'Override Action "Open" commands'.
Step 8. Select the destination as folder and select the same folder i.e 'pics' or as appropriate.
Step 9. In the File Naming box, select from the first Drop Down 'Document Name' and in the next drop down type the letter 't' and in the third drop down select 'extension'.
Step 10. In the Errors box, select on 'Log Errors to File' and select a file for logging errors.
Step 11. Click on ok. Presto your work would be done.
P.S: This is how your batch window whould look with all the options selected as I've posted here:

| rohan2kool wrote: |
| It is better to use photoshop. As it does better interpolation and gives smoother effects. |
- Photoshop is a rather expen$ive tool if one only wishes to generate thumbnails and one does not already have Photoshop.
- Thumbnails, by definition, are not necessarily supposed to be super-duper high quality. As long as they provide sufficiently clear representations of the original images, they have served their purpose.
I meant it is better to use Photoshop, IF you have it...

But if you don't have it, there are free alternatives. Infanview, Gimp and Photo Plus can all resize images. Infanview also lets you control color depth and quality.
It is better to do it your self, you have more control over the quality of the thumbnail.
Thank you both for the help... I do have PS btw came with the computer
thanks again for the help
Well I tried that thing you uploaded to the web for PS and it didnt work. could you please test it and see if it works right for you?
I do not how to make them.
Please reply
PS wth is the link to my pictures for a img src if
they are all inside of my public_html folder in a folder called pix?
../pix/0000001.jpg ?
Yes it works for me. Did you by mistake check the 'Override Action 'Open' commands' or 'Override Action 'Save' commands'. Make sure they are both unchecked.
It works fine for all except for the problem that it asks me to name the file that I want to save after every time it makes a new thumb.
and I have to tell it i want it to be a jpg or a gif file for each file
Which with 250+ images just now for testing purposes is going to take a long time.
I am expecting to have thousands more it will be way too time consuming
I have everything set up right
[/img]
ok.. i've tried the action and it is giving some problems now. Basically, it is not cross-compatible. You need to have two actions: One for indexed colors and one for non-indexed colors i.e you have to seperate out .gif and .jpeg/.jpg/.bmp/.png files. And then apply the actions differently. I'll make the changes for you and present you with both the scripts.
P.S: Actually.. the problem it was asking you to select was my fault. You need to select the 'Override Action "Save As" commands". Sorry..
Your not seriously going to PhotoShop every picture uploaded are you? The php thing is more than enough! As someone has already stated, a thumbnail is only supposed to give you a general idea of what's in the picture anyway. It seems silly to PS every picture when a php script will do a decent job. I mean, I've seen some pretty bad thumbnails come out of photo editors too. Especially if the picture is already low quality anyway... it won't make a difference... at least not doing it on the fly like that.
http://phpthumb.sourceforge.net/
As said before phpThumb will do an excellent job, it interpolates automatically, you can automatically add watermarks, and you can rotate images, all on the fly. It saves lots of time over PS or Gimp, while getting the same results.
Once I got it setup you just insert:
| Code: |
<img src="thumb/phpThumb.php?src=../images/computer.jpg&w=80" style="float: left;" alt="Picture of Computer" /> |
the & are just &, but I wanted it XHMTL valid; the w=80 specifies the width, and PHPthumb keeps the aspect ratio the same.
You can see an example of this on my main page, the picture of the computer and the frihost logo are both sent through phpThumb to get a smaller, interpolated, thumbnail. You can also make them clickable, to enlarge to the fullsize image just by linking to the full size image.
Thank you all very very much for the help... maybe I will try everyone of these little hints...
And maybe... just maybe... I will show my site when I finally getting it to work properly ; )