Thumbnails for websites

Thumbnails for websites

Re: Thumbnails for websites Posted by Le Chief on Fri Sep 5th 2008 at 11:53pm
Le Chief
2605 posts
Posted 2008-09-05 11:53pm
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
Hey

Well, I'm getting a bit sick of imageshack and their unreliability, and I would like to become more self sufficent.

So my question is, how do I create thumbnails for my images like imageshack (and Snarkpit!) does? Do I need to manually resize the images and make them link to the original image and upload both the thumbnail and original image, or is there a better way to do it? I remember larchy mentioning something about ajax.

Anyway, thanks in advance! :)
Re: Thumbnails for websites Posted by larchy on Sat Sep 6th 2008 at 11:24am
larchy
496 posts
Posted 2008-09-06 11:24am
larchy
fluffy teim
super admin
496 posts 87 snarkmarks Registered: Jan 14th 2008 Occupation: kitten fluffer Location: UK
Um, depends.

I've never personally used imageshack, but I assume that when you hotlink to an image hosted there the webserver returns a thumbnail of the image you linked to.

If thats what happens then the thumbs will be generated on the fly most likely (or they get generated when you first upload the image etc). There are libraries that let you write scripts to handle that - the way I added the thumbnail generation for oversize images on these forums was by using the php GD libraries to check the size of the image and generate+output a hyperlinked thumbnail if the image was over certain dimensions. There are potential drawbacks to this approach, but it seems to be working ok for now.

All this is server-side stuff though. If you just want somewhere to host your images, and you want a thumbnail to link to, then yeah you'd have to create your own thumbs and do what you say.... hopefully the above explains what is going on with imageshack etc a bit better though.

AJAX is "asynchronous javascript and xml" and isn't anything to do with that. It lets you do change elements of a page & communicate with the server without refreshing the entire page... for example I have an early version of the snarkpit's map upload page where when you add a map or images to the file input fields they upload in the background (ie before you press the submit button) while you fill out the rest of the page. Sadly it proved that it would be too awkward to implement very well because while AJAX just needs javascript & xml and therefore prettymuch works on any browser without needing anything special, there are a few things needed server side - namely a 'framework' or library that lets you 'do stuff', such as tigermouse or sajax - which isn't present, and most need/work best on php5. You can get by and do stuff without them, but really its not a very good idea.
Re: Thumbnails for websites Posted by G4MER on Sat Sep 6th 2008 at 2:45pm
G4MER
2460 posts
Posted 2008-09-06 2:45pm
G4MER
floaty snark rage
member
2460 posts 360 snarkmarks Registered: Sep 6th 2003 Location: USA
http://www.cooliris.com/site/support/download-all-products.php

If you have a web page you can create thumbnails for your site with this I think.

If not that then this will do the trick.

http://www.fookes.com/ezthumbs/

The way I have done it is I have a thumb folder and an image folder, normally one inside the other, I make the thumbs, and have the big image pop up when the thumb is clicked.

Here is something else I found..

http://www.ibdhost.com/help/optimize/thumb.php

http://schmidt.devlib.org/java/save-jpeg-thumbnail.html

Oh hey I forgot about this software.. not what your looking for really, but its cool in its own right.

http://www.cerious.com/
Re: Thumbnails for websites Posted by Le Chief on Sun Sep 7th 2008 at 7:47am
Le Chief
2605 posts
Posted 2008-09-07 7:47am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
Ah, thanks you two guys :).

Anyway, the problem isn't so much creating the thumbnails and hosting them, its creating the code for the thumbnails (very tedious time consuming work, I have 100+ images).

What I thought I might do is learn PHP and create some sort of web page for me to use that will generate the code for me, ant it would just be a matter of pasting that code onto the website, that'd be easier than making the hyperlink for the image and making the right image have the right thumbnail.
Aaron's Stuff
Re: Thumbnails for websites Posted by larchy on Sun Sep 7th 2008 at 12:24pm
larchy
496 posts
Posted 2008-09-07 12:24pm
larchy
fluffy teim
super admin
496 posts 87 snarkmarks Registered: Jan 14th 2008 Occupation: kitten fluffer Location: UK
The way you'd do it is to have a file upload form which will take an image, save it on the server and create a thumbnail (could be preset dimensions or add the dimension fields to the form to make them variable... the gd libraries will handle all that fine), then spit out a "upload successful, code is: [blah]" message.

It wouldn't actually be very difficult, although you'd need an edit/delete form too and presumably some sort of basic login system.
Re: Thumbnails for websites Posted by Le Chief on Mon Sep 8th 2008 at 8:24am
Le Chief
2605 posts
Posted 2008-09-08 8:24am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
Yeah, I think I might go with the "Admin PHP" thing, that'd be pretty sweet and I would feel like I have some authority :P. While I'm at it, I could make my own guestbook!

Cheers Larchy :beer:. Don't be too helpful or you might guilt me into giving you money, seeing as how you are a web designer and all.

And thanks for the links muhany ;).
Aaron's Stuff
Re: Thumbnails for websites Posted by larchy on Mon Sep 8th 2008 at 10:41am
larchy
496 posts
Posted 2008-09-08 10:41am
larchy
fluffy teim
super admin
496 posts 87 snarkmarks Registered: Jan 14th 2008 Occupation: kitten fluffer Location: UK
Pff it'd hardly be much of a stretch m8 the amount of my time I spend helping ppl with all sorts of stuff. Feel free to gimme a buzz if you need a hand with anything.

The login stuff shouldn't be an issue as you can just do a simple one with hardcoded values and there are loads of tutorials out there for that. The upload form is pretty simple too, although handling saving the file on the server can be a bit confusing... I've got a few classes that you can just drop in to give you some functions to make all that easier, and a class that helps with manipulating images that would be really helpful for you.

Have a look at XAMPP or WAMPServer2 as platforms for local development - its much easier to be able to mess around locally than have to be constantly uploading to a remote server.