Difference between revisions of "Photo Gallery with igal - online image gallery generator"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
(Photo Gallery with igal)
 
m
 
(33 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 
{{Articles}}
 
{{Articles}}
by andre
+
<small>by andre</small>
 
+
<table align=right><tr><td>http://www.stanford.edu/~epop/igal/cy50f.jpg</td></tr></table>
 
= Photo Gallery with igal =
 
= Photo Gallery with igal =
  
Line 14: Line 14:
 
  cd igal-1.4
 
  cd igal-1.4
 
  mkdir -p /usr/local/bin
 
  mkdir -p /usr/local/bin
  cp igal /usr/local/bin/igal
+
  cp igal /usr/local/bin/
 
  chmod 0755 /usr/local/bin/igal
 
  chmod 0755 /usr/local/bin/igal
 
  mkdir -p /usr/local/man/man1
 
  mkdir -p /usr/local/man/man1
 
  cp igal.1 /usr/local/man/man1/
 
  cp igal.1 /usr/local/man/man1/
  cp mkdir -p /usr/local/lib/igal
+
  mkdir -p /usr/local/lib/igal
 
  cp README THANKS ChangeLog COPYING indextemplate.html slidetemplate.html tile.png igal.css /usr/local/lib/igal/
 
  cp README THANKS ChangeLog COPYING indextemplate.html slidetemplate.html tile.png igal.css /usr/local/lib/igal/
  
Line 25: Line 25:
 
  apt-get install libjpeg-progs netpbm
 
  apt-get install libjpeg-progs netpbm
  
If you want to conserve disk space, as you only need pnmscale from netpbm, proceed like in "Others" (PPC only) instead, afterwards run "apt-get install libjpeg-progs".
+
All you need from netpbm is the pnmscale binary. Optionally, if you want to conserve disk space,  
 +
 
 +
cp -a /usr/bin/pnmscale /usr/local/bin/
 +
cp -a /usr/lib/libnetpbm.so.1* /usr/local/lib/
 +
apt-get remove netpbm
  
 
=== Others (PPC only) ===
 
=== Others (PPC only) ===
  
  wget http://hvkls.dyndns.org/downloads/libjpeg-binaries-ppc.tar.gz
+
  wget http://hvkls.dyndns.org/downloads/libjpeg-pnmscale_binaries-ppc.tar.gz
  tar -C / -xvzf libjpeg-binaries-ppc.tar.gz
+
  tar -C / -xvzf libjpeg-pnmscale_binaries-ppc.tar.gz
  
 
== Configuration ==
 
== Configuration ==
  
* Set up a custom instance of thttpd (the webserver shipping with the LS), as described in [http://linkstationwiki.net/index.php?title=Run_a_second_instance_of_thttpd_%28on_an_alternate_port%29 here]. Advanced users might prefer to use [http://linkstationwiki.net/index.php?title=Run_a_third_instance_of_thttpd_as_an_SSL_server%2C_via_stunnel] instead. We'll assume your server root is ''/mnt/share/www'' (LS1 style) in this example.
+
* Set up a custom instance of thttpd (the webserver shipped with the LS), as described [http://nas-central.org/index.php?title=Run_a_second_instance_of_thttpd_%28on_an_alternate_port%29 here]. Advanced users might prefer [http://nas-central.org/index.php?title=Run_a_third_instance_of_thttpd_as_an_SSL_server%2C_via_stunnel this setup] instead. We'll assume your server root is ''/mnt/share/www'' (LS1 style) in this example.
  
* Create the shared photos directory
+
* Create the directory that will hold the photos you want to share
 
  mkdir /mnt/share/www/photos
 
  mkdir /mnt/share/www/photos
  
 
* Protect the directory with a password (optional)
 
* Protect the directory with a password (optional)
  thtpasswd -c /mnt/share/www/photos/.htpasswd photos # enter a password when prompted
+
  htpasswd -c /mnt/share/www/photos/.htpasswd photos # enter a password for user "photos"
  
* Copy photos into /mnt/share/www/photos, organize them into subdirectories if you want.  
+
* Copy photos into /mnt/share/www/photos/, organize them into subdirectories if you want.  
  
* Set up a script that generates the galleries if necessary, on a daily basis. If your directory /mnt/share/photos is password protected, the subdirecories will inherit the password. See "man igal" for the options passed to the program.
+
* Set up a script that generates the galleries if necessary, on a daily basis. If your directory /mnt/share/www/photos is password protected, the subdirecories will inherit the password. See "man igal" for the options passed to the program.
  
<nowiki>echo '#! /bin/sh
+
mkdir /etc/cron.daily 2>/dev/null
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
echo '#! /bin/sh
DIR="/mnt/share/www/photos"
+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
for dir in $(/bin/ls -1 ${DIR}/ | /usr/bin/tr "\n" " "); do
+
DIR="/mnt/share/www/photos"
  test -d $DIR/${dir} && /usr/bin/nice -n 19 /usr/local/bin/igal --bigy 480 -n -w 5 -d ${DIR}/${dir}/
+
for dir in $(ls -1 ${DIR}/ | tr "\n" " "); do
  test -d $DIR/${dir} && cp ${DIR}/.htpasswd ${DIR}/${dir}/
+
test -d $DIR/${dir} && igal --bigy 480 -n -d ${DIR}/${dir}/
done' > /etc/cron.daily/igalAB
+
test -d $DIR/${dir} && cp ${DIR}/.htpasswd ${DIR}/${dir}/
chmod 0755 /etc/cron.daily/igalAB</nowiki>
+
done' > /etc/cron.daily/igalAB
 +
chmod 0755 /etc/cron.daily/igalAB
 +
 
 +
* Optional: hourly generation
 +
 
 +
mkdir /etc/cron.hourly 2>/dev/null
 +
echo '#! /bin/sh
 +
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 +
DIR="/mnt/share/www/photos"
 +
for dir in $(ls -1 ${DIR}/ | tr "\n" " "); do
 +
test -d $DIR/${dir} && igal --bigy 480 -n -d ${DIR}/${dir}/
 +
test -d $DIR/${dir} && cp ${DIR}/.htpasswd ${DIR}/${dir}/
 +
done' > /etc/cron.daily/igalAB
 +
chmod 0755 /etc/cron.hourly/igalAB
  
 
* If you want to create the galleries manually, run
 
* If you want to create the galleries manually, run
Line 59: Line 76:
 
whenever you want.  
 
whenever you want.  
  
* Point you web browser to http://linkstation/photos/ and enjoy!
+
* Point your web browser to http://linkstation:81/photos/ and enjoy!
 +
 
 +
[[Category:Mediaserver]]
 +
[[Category:Howto]]
 +
[[Category:Software]]

Latest revision as of 01:54, 11 September 2007

by andre

cy50f.jpg

Contents

Photo Gallery with igal

All you want is share your photos, but you don't want to install one of these bloated media servers? igal is for you!

Installation

All users

wget http://www.stanford.edu/~epop/igal/igal-1.4.tar.gz
tar -xvzf igal-1.4.tar.gz
cd igal-1.4
mkdir -p /usr/local/bin
cp igal /usr/local/bin/
chmod 0755 /usr/local/bin/igal
mkdir -p /usr/local/man/man1
cp igal.1 /usr/local/man/man1/
mkdir -p /usr/local/lib/igal
cp README THANKS ChangeLog COPYING indextemplate.html slidetemplate.html tile.png igal.css /usr/local/lib/igal/

Debian users

apt-get install libjpeg-progs netpbm

All you need from netpbm is the pnmscale binary. Optionally, if you want to conserve disk space,

cp -a /usr/bin/pnmscale /usr/local/bin/
cp -a /usr/lib/libnetpbm.so.1* /usr/local/lib/
apt-get remove netpbm

Others (PPC only)

wget http://hvkls.dyndns.org/downloads/libjpeg-pnmscale_binaries-ppc.tar.gz
tar -C / -xvzf libjpeg-pnmscale_binaries-ppc.tar.gz

Configuration

  • Set up a custom instance of thttpd (the webserver shipped with the LS), as described here. Advanced users might prefer this setup instead. We'll assume your server root is /mnt/share/www (LS1 style) in this example.
  • Create the directory that will hold the photos you want to share
mkdir /mnt/share/www/photos
  • Protect the directory with a password (optional)
htpasswd -c /mnt/share/www/photos/.htpasswd photos # enter a password for user "photos"
  • Copy photos into /mnt/share/www/photos/, organize them into subdirectories if you want.
  • Set up a script that generates the galleries if necessary, on a daily basis. If your directory /mnt/share/www/photos is password protected, the subdirecories will inherit the password. See "man igal" for the options passed to the program.
mkdir /etc/cron.daily 2>/dev/null
echo '#! /bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DIR="/mnt/share/www/photos"
for dir in $(ls -1 ${DIR}/ | tr "\n" " "); do
test -d $DIR/${dir} && igal --bigy 480 -n -d ${DIR}/${dir}/
test -d $DIR/${dir} && cp ${DIR}/.htpasswd ${DIR}/${dir}/
done' > /etc/cron.daily/igalAB
chmod 0755 /etc/cron.daily/igalAB
  • Optional: hourly generation
mkdir /etc/cron.hourly 2>/dev/null
echo '#! /bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DIR="/mnt/share/www/photos"
for dir in $(ls -1 ${DIR}/ | tr "\n" " "); do
test -d $DIR/${dir} && igal --bigy 480 -n -d ${DIR}/${dir}/
test -d $DIR/${dir} && cp ${DIR}/.htpasswd ${DIR}/${dir}/
done' > /etc/cron.daily/igalAB
chmod 0755 /etc/cron.hourly/igalAB
  • If you want to create the galleries manually, run
/etc/cron.daily/igalAB

whenever you want.