############################################################################### # JondZ' Picture Organizer # # Copyright (C) 2002 Edward Pike (JondZ) # # # # This program is free software; you can redistribute it and/or # # modify it under the terms of the GNU General Public License # # as published by the Free Software Foundation; either version 2 # # of the License, or (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # ############################################################################### # Jan 29 2002 - JondZ release # Feb 01 2002 - JondZ changed installation procedure for loader # Feb 02 2002 - JondZ MAJOR mounting bug workaround ------------------------ JONDZ' PICTURE ORGANIZER ------------------------ Installation Instructions ------------------------- ------------------------------------------------------------------------------ NOTES AND WARNINGS The programs described here create a LOT of files. Be careful--I would suggest to test the procedure first on a test machine containing no mission-critical or important data if you have such a machine available. A LOT of the files created by the programs are ABSOLUTE SYMBOLIC LINKS. After installation is successful, please take the time to examine the created files to see which are links and which are real files. Usually you cannot RELIABLY TRANSFER SYMBOLIC LINKS TO ANOTHER MACHINE using normal backup procedures (you have to "deference" them). Tested on: Redhat Linux 7.2 Supports only JPG files. ------------------------------------------------------------------------------ 1. CHECK YOUR EQUIPMENT First of all, you should check if you can use these programs at all. You need: - A digital camera using SmartMedia or a CompactFlash; - A SmartMedia or a CompactFlash PCMCIA adapter. - A Linux box with a PCMCIA slot. Load your SmartMedia or CompactFlash card into the PCMCIA adapter, insert that into your computer's PCMCIA slot. Mount READ-ONLY the SM or CF card as a regular Linux filesystem. If this can be done, then you're ok. For example, insert the PCMCIA card. You should see something like these in the system logs (/var/log/messages) Jan 27 05:02:28 madugas cardmgr[988]: initializing socket 1 Jan 27 05:02:28 madugas cardmgr[988]: socket 1: ATA/IDE Fixed Disk Jan 27 05:02:28 madugas kernel: cs: memory probe 0x0d0000-0x0dffff: clean. Jan 27 05:02:28 madugas cardmgr[988]: executing: 'modprobe ide-cs' Jan 27 05:02:29 madugas kernel: hdi: SanDisk SDCFB-128, ATA DISK drive Jan 27 05:02:29 madugas kernel: ide4 at 0x100-0x107,0x10e on irq 3 Jan 27 05:02:29 madugas kernel: ide-floppy driver 0.97.sv Jan 27 05:02:29 madugas kernel: hdi: 250880 sectors (128 MB) w/1KiB Cache, CHS=980/8/32 Jan 27 05:02:29 madugas kernel: hdi: hdi1 Jan 27 05:02:29 madugas kernel: ide_cs: hdi: Vcc = 5.0, Vpp = 0.0 Jan 27 05:02:29 madugas cardmgr[988]: executing: './ide start hdi' Jan 27 05:02:30 madugas kernel: hdi: hdi1 This is a clue that the disk would be /dev/hdi (yours will be different). You can attempt to mount a partition, i.e., mount -r /dev/hdi1 /mnt/tmp and check the files in there. If it works, then your all set. If you are unable to do this, then perhaps this is not for you. If your digital camera has a Time/Date function, make sure that it is current. 2. DECIDE WHERE YOU WANT TO PLACE YOUR JPG PICTURE FILES. You will need to decide on the following directories: 2.1. A main storage area 2.2. A directory to hold icons and other low-resolution derived JPG files. 2.3. A directory to hold backup image volumes. 2.4. A directory to hold html-indexed image volumes. 2.4. A directory to hold the main website image. We will use the following examples for this: Main Storage - /pictures/digital Icon Directory - /misc/picimage/digital CD Backup Image - /misc/picimage/cdbackup CD Production volumes - /misc/picimage/cdprod Main website - /www/pictures A description of these directories follow: Main Storage (example: /pictures/digital) - Here is where the master JPG images will be placed. Icon Directory (example: /misc/picimage/digital) - Here is where all DERIVATIVE JPG images will reside. By derivative we mean icon files and lower-resolution files. You will want to KEEP THIS SEPARATE from your Main Storage to avoid confusion later. CD Backup Image (example: /misc/picimage/cdbackup) - Here is where LINKS to the Main Storage will be stored. Directories will be created there corresponding to CD Volumes of around 600 megs each. These directories will each contain SYMBOLIC LINKS pointing to the Main Storage. CD Production Volumes (example: /misc/picimage/cdprod) - Very similar to the CD Backup Image directory, but this will contain SYMBOLIC LINKS to icon and lower-resolution version of the original images as well; and also a bunch of HTML files for each volume. Therefore you can burn the CD Volumes and distribute them and each would have its own HTML file that can be viewable by any web browser. Main Website - (example: /www/pictures) - This is simply like the CD Production Volume above except that it not split into volumes. Therefore the directory would contain links to ALL images, ALL icons and ALL low resolution versions, and there would a master HTML file to view them all. You can then serve this diretory out of your machine using a web server, or view it directly using a web browser. 3. SETUP THE PCMCIA LOADER 3.1. Select a card socket you are going to use for uploading files into the computer. Usually there are 2 sockets and they are labeled 0 or 1. 3.2. Extract the files and put them into your shell executable path. 3.3. As root, CREATE a mount point DIRECTORY where the pcmcia card will reside. For this example we'll use /mnt/tmp. So we'll do mkdir /mnt/tmp 3.4. As root, edit the file /etc/pcmcia/ide.opts and look for the following lines: ---------------------------------------------------------------- case "$ADDRESS" in *,*,*,1) #INFO="Sample IDE setup" #DO_FSTAB="y" ; DO_FSCK="y" ; DO_MOUNT="y" #FSTYPE="msdos" #OPTS="" #MOUNTPT="/mnt/ide" ;; *,*,*) #PARTS="1" # Card eject policy options NO_CHECK=n NO_FUSER=n ;; esac ---------------------------------------------------------------- and make it look like this (assuming username is "jondz", mount point is /mnt/tmp, and pcmcia slot to use = 1): ---------------------------------------------------------------- case "$ADDRESS" in *,1,*,1) #INFO="Sample IDE setup" #DO_FSTAB="y" ; DO_FSCK="y" ; DO_MOUNT="y" #FSTYPE="msdos" #OPTS="" #MOUNTPT="/mnt/ide" DO_FSTAB="n" ; DO_FSCK="n" ; DO_MOUNT="y" FSTYPE="msdos" OPTS="ro" MOUNTPT="/mnt/tmp" ;; *,1,*,10) su - jondz -c "picture_upload.pl -s /mnt/tmp -d /pictures/digital" umount /mnt/tmp ;; *,*,*) #PARTS="1" PARTS="1 10" # Card eject policy options NO_CHECK=n NO_FUSER=n ;; esac ---------------------------------------------------------------- As another example, if username is foo and pcmcia slot to use = 0, the file should read: ---------------------------------------------------------------- case "$ADDRESS" in *,0,*,1) #INFO="Sample IDE setup" #DO_FSTAB="y" ; DO_FSCK="y" ; DO_MOUNT="y" #FSTYPE="msdos" #OPTS="" #MOUNTPT="/mnt/ide" DO_FSTAB="n" ; DO_FSCK="n" ; DO_MOUNT="y" FSTYPE="msdos" OPTS="ro" MOUNTPT="/mnt/tmp" ;; *,0,*,10) su - foo -c "picture_upload.pl -s /mnt/tmp -d /pictures/digital" umount /mnt/tmp ;; *,*,*) #PARTS="1" PARTS="1 10" # Card eject policy options NO_CHECK=n NO_FUSER=n ;; esac ---------------------------------------------------------------- if you want diagnostic messages emailed to you, you can change the line su - foo -c "picture_upload.pl -s /mnt/tmp -d /pictures/digital" to su - foo -c "picture_upload.pl -s /mnt/tmp -d /pictures/digital | mail foo@host" where foo@yourhost is your email address. You can also log the uploader output to a file, i.e., su - foo -c "picture_upload.pl -s /mnt/tmp -d /pictures/digital > /tmp/picture_upload.log" 4. TEST THE PCMCIA LOADER First of all backup your digital camera CompactFlash or SmartMedia card using your normal backup procedures. If your CF or SM card is now empty, snap some sample pictures. Insert the CF or SM card into the PCMCIA adaptor, and put that into the computer. Wait a couple of seconds for disk activity to stop (NOTE: I removed the speaker beep code for now, I will put it back in a later version). Check if the files were in fact uploaded to the computer, i.e., you should have some new files like these: /pictures/digital/2001/2001-02-feb/pic-2001-02-18-0030.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-18-0031.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-18-0032.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-18-0033.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-18-0034.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-21-0001.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-21-0002.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-22-0001.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-22-0002.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-22-0003.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-22-0004.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-22-0005.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-22-0006.jpg /pictures/digital/2001/2001-02-feb/pic-2001-02-22-0007.jpg Check if the files uploaded correctly, i.e., view the files with your favorite image displayer program (gimp, ee, whatever). You can now remove the PCMCIA card. If it works, congratulations!!! You now have a method to upload your camera files very easilly!!! ========================================================================== At this point you should have a working computer where you can just insert the PCMCIA card and it files the pictures according to the format above. ========================================================================== ========================================================================== WARNING: DO NOT DO THE NEXT STEPS AS USER root. TEST THEM USING NORMAL UNIX ACCOUNTS WITH NORMAL PRIVILEGES. ========================================================================== 5. SETUP THE BATCH PROCESS Look for and edit the file picture_build in this package. Look for the lines set MASTER_DIGITAL_SOURCE = set LOWRES_DIGITAL_MIRROR = set WWW_DIGITAL = set CDBACKUP_DIGITAL = set CDPROD_DIGITAL = and write in the directories as discussed in Step 2 above. Continuing our example these would be: set MASTER_DIGITAL_SOURCE = /pictures/digital set LOWRES_DIGITAL_MIRROR = /misc/picimage/digital set CDBACKUP_DIGITAL = /misc/picimage/cdbackup set CDPROD_DIGITAL = /misc/picimage/cdprod set WWW_DIGITAL = /www/pictures 6. TEST THE BATCH PROCESS Test-run the batch process picture_build; a sample output is provided in the file picture_build.sample_output. Your output should be similar. Check that the appropriate files are created, for example the file /www/pictures/index.html should have been created. 7. PUT THE BATCH PROCESS IN CRONTAB You should now be able to run picture_build as a background process; for example, you can enter the following to the root's crontab list to make it run every morning at 5:00: 0 5 * * * su - yourname -c "picture_build > /tmp/picture_build.log" (where "yourname" is your unix user name). 8. (OPTIONAL) EXPORT YOUR PICTURES OUT OF YOUR SERVER Since you now have a stable method of archiving your pictures, you can then export the files by FTP, NFS, or even SAMBA. Dont forget to password-protect your website!!! ----------------------------------------------------------------------------- IMPORTANT NOTE: A lot of the directories above contain SYMBOLIC LINKS, not regular files. If you are burning CD-ROMs in Linux, make sure that the burning software UNDERSTANDS AND FOLLOWS THE SYMBOLIC LINK files. ----------------------------------------------------------------------------- Have fun! JondZ Tue Jan 29 03:03:49 EST 2002