View Full Version : Need suggestions for some kind of a photo gallery software

September 22nd, 2010, 08:42 AM
Hello guys !!

So I have an internet accessible desktop. To that, I have attached a terabyte hard disk. In my fstab I have made the necessary modifications so that the hard disk is mounted in a directory within my ~ HOME directory, and mounted with uid,gid of my user. In that, there's a "Photographs" directory, and plenty of sub directories, each with potentially more subdirectories with photographs.

What I want to be able to do is easily display the photographs on the web. I have registered dynamic DNS with dyndns.com and have a hostname (harisund.homelinux.com !)

A. I want the gallery software to automatically display the folders I have in that ~/TerabyteMountPoint/Photographs folder in a photo gallery format.
B. For the purpose of the webpage, the resolution of the images should be small.
C. Users should be given the option of downloading the pictures/directories they want, and with the full resolution if they so desire.

Any suggestions? I have a Ubuntu server installation on this desktop, with LAMP enabled !

September 22nd, 2010, 01:25 PM
Here's a PHP script I wrote to display a bunch of image files in a tabular format. You're welcome to it.

<head><title>My Photographs</title></head>


<h3>My Photographs</h3>

<p>Click on an image to make it full-size.</p>
<p>Right-click an image and choose "Save" to download it.</p>


# set these as desired
$max_width=150; # maximum displayed width of thumbnails
$per_row=4; # number of images per row

# here be monsters, cap'n
$files=explode("\n",`ls $imgdir | egrep 'gif|png|jpg|jpeg'`);
#echo "<h4>rows=$rows</h4>";
<h4>There are <?=count($files)?> images available.</h4>


for ($r=0; $r<$rows; $r++) {

echo "<tr>";

for ($c=0; $c<$per_row; $c++) {

if (!empty($files[$avcounter])) {
#echo "<h4>imgdata for '$fn' has ".count($imgdata)." elements</h4>";

$sizerow.="<td style=\"padding-left: 12px; padding-right: 12px\">".
$files[$avcounter]."<br/>($width x $height) ";

if ($fs < 2048) {
} else {

if ($width>$max_width) {
$imgsize="width=$width height=$height";

echo "<td style=\"padding:12px\">";
echo "<a href=\"/images/".$files[$avcounter]."\">";
echo "<img $imgsize src=\"/images/".$files[$avcounter]."\"></a></td>";


if ($avcounter>count($files)) {
echo "</tr>\n";


echo "</tr>\n";
echo "<tr>$sizerow</tr>\n";



Call the file index.php and place it in the root of the website tree. Make sure any other index files like index.html are renamed to force the server to use the PHP script by defalt.

The results look like this (http://www.takinganimeseriously.com/images/avatars/).

September 22nd, 2010, 01:42 PM
Run Gallery (http://gallery.menalto.com/)? There is also a module for it in Drupal if you prefer CMSs.

September 22nd, 2010, 01:57 PM
Moved to Server Platforms.