LinkedPhotoImport: Difference between revisions

From Bitpost wiki
No edit summary
No edit summary
Line 51: Line 51:
Now all we need is the [http://www.thedigitalmachine.com/files/import_latest_pictures.pl.tar.gz linked photo import script]!  You'll have a lot of photos in the dump directory at this time.  The script will take those photos, import them, and move them to the archive dir.  It will also set up symlinks from dump_cameras_here to archive, so the nightly copies from the Windoze boxes only copy new photos.  It will also find the copies of the photos in the gallery-data directory and replace them with symlinks to the photos in archive.
Now all we need is the [http://www.thedigitalmachine.com/files/import_latest_pictures.pl.tar.gz linked photo import script]!  You'll have a lot of photos in the dump directory at this time.  The script will take those photos, import them, and move them to the archive dir.  It will also set up symlinks from dump_cameras_here to archive, so the nightly copies from the Windoze boxes only copy new photos.  It will also find the copies of the photos in the gallery-data directory and replace them with symlinks to the photos in archive.


I went through a lot of pain getting this thing working, and you will probably need to make a few tweaks to it yourself. Open it up and update the directory locations at the top to match your setup. In gallery, add a top-level album named "unsorted".  Use galleryadd.pl with the "-l" option to list the albums, and get the number for the unsorted album.  Update the script to use that album number. Finally, try out the script with a small photo set.  With a little luck you'll have it up and running in short order.
I went through a lot of pain getting this thing working.  It's in pretty good shape, but you will need to make a few tweaks to it to match your installation.
 
* Update the directory locations at the top to match your setup.
* In gallery, add a top-level album named "unsorted".  Use galleryadd.pl with the "-l" option to list the albums, and get the number for the unsorted album.  Update the script to use that album number.
* Update the username and password to match a valid user in your gallery installation.
* Finally, try out the script with a small photo set; wash, rinse, repeat as needed.   
 
With a little luck you'll have it up and running in short order.


You're ready to manage your photos in gallery now.  To share:
You're ready to manage your photos in gallery now.  To share:

Revision as of 22:11, 29 February 2008

Requirements:

  • Gather photos from several locations (Windoze PC's) into one linux-based central media repository (aka mediacenter)
  • Leave the photos at the original locations
  • Anticipate some maintenance of photos at the original locations
  • Use gallery (a great LAMP webapp) to manage the mediacenter photos
  • Minimize duplication on the mediacenter
  • Management should include creation of a public directory for shared photos
  • Access to public photos via the web and for screensavers

Solution components:

  • gallery on mediacenter
  • galleryadd.pl, for scripted uploads to gallery
  • xscreensaver on mediacenter
  • Windows nightly batch-file task to copy new photos to mediacenter
  • linked photo import script
  • Four directories on mediacenter
  • archive - holds original photos dump - holds newest photos and symlinks to old in archive managed - holds symlinks to archive public - symlink to public directory in managed

Process:

First, create the directory structure on mediacenter:

mkdir /media/photos/unmanaged
mkdir /media/photos/unmanaged\archive
mkdir /media/photos/unmanaged\dump_cameras_here
mkdir /media/photos/managed
mkdir /media/photos/public

Set up a samba share for dump_cameras_here.

Next, set up a task on each of the Windoze PC's to copy files to the share every night. This will only copy files that have not already been copied:

xcopy /D /Y /S c:\myphotos\* \\mediacenter\dump_cameras_here\

You might as well run the task next.

Now to set up the mediacenter. Install gallery, and configure it to store its data directory here:

/media/photos/managed/gallery-data

Now all we need is the linked photo import script! You'll have a lot of photos in the dump directory at this time. The script will take those photos, import them, and move them to the archive dir. It will also set up symlinks from dump_cameras_here to archive, so the nightly copies from the Windoze boxes only copy new photos. It will also find the copies of the photos in the gallery-data directory and replace them with symlinks to the photos in archive.

I went through a lot of pain getting this thing working. It's in pretty good shape, but you will need to make a few tweaks to it to match your installation.

  • Update the directory locations at the top to match your setup.
  • In gallery, add a top-level album named "unsorted". Use galleryadd.pl with the "-l" option to list the albums, and get the number for the unsorted album. Update the script to use that album number.
  • Update the username and password to match a valid user in your gallery installation.
  • Finally, try out the script with a small photo set; wash, rinse, repeat as needed.

With a little luck you'll have it up and running in short order.

You're ready to manage your photos in gallery now. To share:

  • Make a top-level public album in gallery.
  • Set the permissions to allow Everybody to view it
  • Remove permissions from other top-level albums
  • Create a symlink to /media/photos/managed/gallery-data/albums/public in a convenient location
  • Share the symlink over samba, etc.
  • Move photos into and out of the public album in gallery, as desired, and they'll become available in the public share.