1

Gallery - http://schnell.dreamhosters.com/wallpapers.php

The purpose of this gallery is simple - store a lot of wallpapers and sort them by resolution and/or aspect ratio for people to browse and download as they like. There's a few features I've wanted to work in, but I'm not quite sure how best to do them or how to do them at all. The presentation is in HTML 4, CSS, Javascript and jQuery + plugins. The work behind the scenes is done in PHP.

1 - Make the images downloadable without 'Save Image As...'. Right now I'm using a contrivance whereby clicking the Download link in the bottom-right of each image's box opens a new box with instructions telling the user to 'Right Click. Save Image As...'. I'd like to avoid this entirely if possible.

2 - Make the searching and sorting faster and more efficient. Right now all the images are stored in a folder on my webspace and I use a shell command and a lot of fancy filtering in PHP to get the images I want based on the filters (the page number I'm on and the aspect ratio or resolution I chose). I thought of maybe doing something with MySQL, but I haven't quite figured out yet how I'd do that and maintain the structure my page has.

3 - Make the images load faster. There's probably no easy coding solution to this, so this one is more of a 'I wish' than a 'I want to'.

4 - Improve the layout. This one is more subjective and 'artsy' I suppose, but any suggestions would be nice.

5 - An upload system. Give the ability to upload your own wallpapers and maybe include a short description or some tags. I have absolutely no idea how to handle this as I've never worked with uploading of files before. And this also leads to...

6 - A tagging system or some other type of user-made sorting system. Again, no experience here.

Any insight on any of these issues would be great, and feel free to throw in any suggestions of your own.

1
  • maybe you can compare it with another website Feb 4, 2011 at 9:22

1 Answer 1

0
  1. Send the files with the MIME type "application/octet-stream" to make a browser download rather than display them

  2. It would definitely be better to store information about the images in a database rather than exploring the filesystem

  3. The images really aren't loading slowly for me, so I can't really suggest anything here. If your site gets larger (much larger) you might want to look into CDNs

  4. The layout is OK but it needs some design, it's incredibly plain at the moment. It would also be nice to see more information on the images - what they are of, where they're from, who made them, etc (don't forget: correct copyright attribution)

  5. You probably want to read the PHP handbook section on handling file uploads. To handle description and tags, you'll definitely want a database of some sort.

  6. Also not hard if you have a correctly formed database. If you've never designed a schema before you probably want to learn a little about normalisation and many-to-many relationships to do the tags.

Lastly you didn't ask for it, but it'd be nice if it were possible to have the same image in multiple resolutions (quite common on image sites - think Flickr, Deviantart, etc).

2
  • Thanks for the suggestions. When you say 'send' the files, how do you mean and how do you change the MIME type? Also, for the sake of being legally safe, I've already scrubbed the collection of wallpapers clean of any images that had copyright text on them. Of course that doesn't mean that others aren't copyrighted, but the main problem is that all of those wallpapers I more or less was given by a friend off a USB drive and I have no idea where they came from. If I expand to a user-submission model then yes that information would definitely be available (if the user adds it). Feb 4, 2011 at 12:45
  • Easy ways to change the MIME type would be either to send the file contents via a PHP script which sets the Content-Type header appropriately, or the faster way of turning it over to the webserver. You could perform some magic so GET /images/01.jpg?asdownload gives the MIME type of a binary file, and GET /images/01.jpg sends the normal JPEG MIME type (image/jpeg), or maybe /download/01.jpg for download and /images/01.jpg for viewing... There are lots of ways to do it. On a tangential note, if you want to find the origin of arbitrary images, tineye.com can be very helpful.
    – ZoFreX
    Feb 4, 2011 at 12:50

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.