Scripts for Galleries

Replies:

Parents:

  • None.

--Boundary-00=_z1n39MY9bBOi20u
Content-Type: text/plain;
 charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


Since everyone seems to have their own scripts for generating galleries,
here's mine! <smile/>  icon call igal. Results look like:
http://goatee.net/photo/web/2002/10/
--Boundary-00=_z1n39MY9bBOi20u
Content-Type: application/x-shellscript;
 name="icon"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="icon"

#!/bin/bash


if [ ! -d ./images ]; then mkdir ./images; fi;
if [ ! -d ./images/thumbs ]; then mkdir ./images/thumbs; fi;

for f in *.jpg;
do
  convert -geometry "600x600>" -quality 60 -border 4x6 -bordercolor black \
  -comment "%c Copyright 2001 http://goatee.net/" -antialias -pointsize 12\
  -font 'helvetica' \
  -fill '#999999' -gravity SouthEast \
  -draw 'text 10,10 "� 2002 http://goatee.net/"' \
  $f ./images/$f
  convert -geometry "150x120"  $f ./images/thumbs/$f;
done

if [ -f .htaccess ]; then
   cp .htaccess images/;
   echo -e "<Files "*.jpg">\nAllow from all\n</Files>" > images/thumbs/.htaccess
   fi;
webdir=`pwd | sed -e 's/hires/web/' -e s/images//`
rm -rf $webdir
if [ ! -d $webdir ]; then mkdir $webdir; fi;
cd images; igal > index.html;
cp -r * $webdir
cd ..; rm -rf images



--Boundary-00=_z1n39MY9bBOi20u
Content-Type: application/x-perl;
 name="igal"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="igal"

#!/usr/bin/perl -w
use strict;

my ($pwd); chop($pwd = `pwd`);

&printHeader;

&printMetadata;

  opendir(DIR, $pwd) || die "\nCould not open $pwd\n";
  my @files = readdir(DIR);
  my $file  = "";
  @files = sort @files;
 
  foreach $file (@files)
     {
     if ($file =~ /jpg$/)
        {
        &printFileName($file);
        }
     }
  closedir (DIR);

&printFooter;


#print the name of the file in hrefs
sub printFileName
{
  my $file = $_[0];
  #print "file = $foo ";

  print <<EOF;
  <a href="$file"><img alt="$file" src="thumbs/$file"/></a>
EOF
}


#print html included in the metadata file
sub printMetadata
{
  if (open(META_FILE, "meta.txt")) {
     my @array = <META_FILE>;
     close(META_FILE);

     foreach (@array) {
         print();
     }
  }
}

#print the top of the html file
sub printHeader
{
  $_=$pwd;
  my ($rewriteURL) = m|/e/photo/web(.*$)|;

  print <<EOF;
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
  <link rel="stylesheet" type="text/css"
  href="http://goatee.net/photo/2001.css"/>
  <title>Gallery for $rewriteURL</title>
  </head>
  <body>
  <h1>goatee.net Archive Gallery</h1>
  <h2>$rewriteURL</h2>
  <div align="center">

EOF
}


#print the bottom of the html file
sub printFooter
{
  print <<EOF;
    <p></p>
    <tt>copyright &copy; 1998-2002 Joseph M. Reagle Jr.
    <a href="mailto:geek\@goatee.net">geek\@goatee.net</a></tt>
  </div>
  </body>
</html>
EOF
}

exit;

--Boundary-00=_z1n39MY9bBOi20u--

Grabbing video frames for galleries (was Re: Scripts for Galleries

Replies:

Parents:

Speaking of galleries, I'd like to find a way to grab a frame from
a video (QT, normally) for inclusion into my gallery pages.  I'm
using ImageMagick now (what else), but couldn't find a way to do that
with it.  Ideas?

(Greetings, btw)

MB
--
Mark Baker.  Ottawa, Ontario, CANADA.   http://www.markbaker.ca

  Will distribute objects for food

Re: Grabbing video frames for galleries (was Re: Scripts for Galleries

Replies:

Parents:

On Fri, Nov 22, 2002 at 02:57:33PM -0500, Mark Baker wrote:
> Speaking of galleries, I'd like to find a way to grab a frame from
> a video (QT, normally) for inclusion into my gallery pages.  I'm
> using ImageMagick now (what else), but couldn't find a way to do that
> with it.  Ideas?

I just happened to drop by http://freshmeat.net/ to look for some
stuff for my printer, and I saw this on the home page:

   PornView 0.1.2 [1]
   by trem0r - Saturday, November 23rd 2002 06:53 PST

   About: PornView is a GTK+-based image viewer/manager. Features
   include thumbnail previews, thumbnail caching, directory tree
   views, and and adjustable zoom. Fullscreen view and slideshows
   allow for basic presentation of images.

   Changes: This release adds file operations, EXIF data, gettext
   support, and a Polish translation, and fixes many small bugs.

I was curious about its 'EXIF data' support, so I went to check
it out and noticed that this screen shot [2] has a popup menu that
says 'Movie -> Create Thumbnail'; might be worth trying.

(I thought the package name was just a joke, but apparently not :)

Hmm... I just compiled and installed it, and it's fairly nice for
something with version number 0.1.2, but I couldn't get it to do
anything with any of the movie formats I happen to have around
(mpeg, avi, quicktime.)

Its view of exif data is quite good; apparently it uses libexif [3]
to do all the dirty work. I'll have to play around with that sometime.

[1] http://pornview.sourceforge.net/
[2] http://pornview.sourceforge.net/screenshots/ss_m.jpg
[3] http://sourceforge.net/projects/libexif

--
Gerald Oskoboiny <[email protected]>
http://impressive.net/people/gerald/

libexif, gexif (general EXIF photo metadata editor)

Replies:

  • None.

Parents:

On Sat, Nov 23, 2002 at 02:30:38PM -0500, Gerald Oskoboiny wrote:

> Its view of exif data is quite good; apparently it uses libexif [3]
> to do all the dirty work. I'll have to play around with that sometime.

> [3] http://sourceforge.net/projects/libexif

I just downloaded and compiled libexif, libexif-gtk, gexif, and exif
(in that order), and this is fantastic stuff!

In particular, gexif is a general EXIF metadata viewing and editing
application; screen shot:

   http://impressive.net/people/gerald/2002/11/24/gexif.png

A few weeks ago I wrote:

| I'd still really like to find a general EXIF editing script.

and this is about 100 times better than anything I expected to find.

'exif' is a command line app that seems pretty useful, too.

Woohoo!

--
Gerald Oskoboiny <[email protected]>
http://impressive.net/people/gerald/

Re: Scripts for Galleries

Replies:

Parents:

On Fri, Nov 22, 2002 at 01:54:43PM -0500, Joseph Reagle wrote:
>
> Since everyone seems to have their own scripts for generating galleries,
> here's mine! <smile/>  icon call igal. Results look like:
> http://goatee.net/photo/web/2002/10/

I keep putting off sending details on my stuff to fogo because I
was hoping to make it more usable first.

But here is a quick summary of what I currently do to publish mine.
(sample: http://impressive.net/people/gerald/2002/italy/photos.html )

   1. gphoto2 -P
   2. epinfo -rf $W/%Y/%m/%d/%H-%M-%S.jpg *.JPG
   3. rename-vids *.AVI
   4. cd $M
   5. make_variants ??/$L &
      (this takes a looong time)
   6. qiv ??/$L
      (do a quick pass through, to delete or resize lame/redundant pics)
   7. captivate --index foo.html */*
      (add titles/descriptions to each photo; generates HTML when done)
   8. edit foo.html to add headings/titles/intro text
   9. cvs add and commit everything

This is too many steps... I'd like to move at least steps 2 through 6
into captivate.

The environment variables W, M, and L are set in my .bashrc:

   W=$HOME/www/people/gerald; export W
   M=$W/`date +%Y/%m`; export M
   L="??-??-??.jpg"; export L

so I can always use $W to refer to my web site document root, $M
to refer to the current monthly dated dir on my site, and $L to
refer to the original versions of my photos; very, very handy.

rename-vids, make_variants, captivate etc are linked from:
http://impressive.net/software/photo/

items near the top of my todo list include:

 - make it usable (make "captivate *" do the right thing for new users)
 - add next/prev/up links on each photo page
 - switch to CSS for style stuff on photo pages
 - add access control, foaf depiction, and quality ratings
 - make a search engine for my photos
 - reduce the number of steps needed to publish (above)

--
Gerald Oskoboiny <[email protected]>
http://impressive.net/people/gerald/

Re: Scripts for Galleries

Replies:

  • None.

Parents:

* Gerald Oskoboiny <[email protected]> [2002-11-22 18:02-0500]

> items near the top of my todo list include:
>
>   - make it usable (make "captivate *" do the right thing for new users)
>   - add next/prev/up links on each photo page
>   - switch to CSS for style stuff on photo pages
>   - add access control, foaf depiction, and quality ratings
>   - make a search engine for my photos
>   - reduce the number of steps needed to publish (above)

I finally did some of this stuff: added next/prev/up links,
switched to CSS for most style/layout stuff; added a bit more
metadata (acl/quality/foaf, but that's not quite right yet)

I regenerated a couple of my photo pages with this new version:

   http://impressive.net/people/gerald/2002/02/dr.html
   http://impressive.net/people/gerald/2003/01/17/spamconf.html

I'm pretty happy with it, but I'm sure the CSS could be improved;
suggestions welcome.

For the thumbnails with captions, I based the layout on some
sample CSS [1] published by Bert. (thanks, very helpful!)

I wanted the page to be usable at any browser width; with my
current 800px-wide browser, there are 4 columns of images, and
on narrower or wider widths there are fewer or more columns.
(much better than some html table solution with a fixed number
of columns!)

I am not quite happy with the absolute positioning of the next/prev/up
links on the foo-sm.html pages, but I don't know how else to do that.
I want to be able to scroll through a gallery by clicking on "Next"
without having to move the mouse around. That seems to work fine
the way I did it, but one potential problem is that the heading text
overruns the navbar text if you make the text larger (or have a
long heading or link text); anyone know how to avoid that?

(I want the navbar stuff to be fixed in the top right, but would
like the text to flow around it when necessary)

[1] http://www.w3.org/Style/Examples/007/figures.html

--
Gerald Oskoboiny <[email protected]>
http://impressive.net/people/gerald/

HURL: fogo mailing list archives, maintained by Gerald Oskoboiny