# 2007/03/26 (lfolland) Instructions for handling photos # Background: This directory is intended to hold photos in the original format received and at the highest resolution available. What to do with new photos: As photos are received, they should be put into the folder of the year of that photo. If they're the latest then a link from that photo should be put into the folder original/latest. For example, if you receive a picture of John Smithinski (userid jsmithinski) in 2007, put the original image in original/2007 with the filename jmithins.jpg (or jmithins.tif or whatever format is used). Note that you should use the 8-character truncation of the userid. Then go into the latest directory and link in the new image (if it's newer), eg: $ cd latest $ rm smithins.jpg (this will remove the old photo) $ ln -s ../2007/smithins.jpg . (Note the final space-dot) This will allow us to look at the files in latest and see which year each photo is from. So when a new picture arrives, place it in $YYYY/$userid8.$type and if it's preferable to what we have, then run rm -f source/$userid8.$type ln -s ../$YYYY/$userid8.$type source where $YYYY is the current year, e.g. 2008 $userid8 is the first 8 characters of the person's userid $type is the picture type, almost always "jpg" these days and then produce the three sizes of it by: ./resizephoto $YYYY/$userid8.$type eg: for the example above, you would enter: ./resizephoto/2007/smithins.jpg IMPORTANT NOTE: YOU MUST DO THE ABOVE ON SOME MACHINE *OTHER* THAN WWW.CS Directories and their purpose: 2008/08/12: ./$YYYY/$whatever: a picture estimated to be from the year $YYYY for $whatever, which might not be a standard userid. ./unknown/$whatever: a picture for which the year is unknown ./timeline/: not sure, but might be the last DVD's we have of pictures from Graphics ./latest/$userid8: symbolic link to the most recent picture for $userid8 (the 8 character truncation of the UW userid) ./source/$userid8: what we'll use to produce ../{thumb,small,large} Warning, symlinks will only work if the owner of the symlink matches the owner of its target. Typically "root". Symlink ownership can be fixed via `chown -h root SymlinkName` Technical Details, if problems with the above: If the thumbnail shows more than just the head and shoulders of the person, the parameters used (by `./resizephoto`) may have to change. This can happen if the original picture includes extra background. To fix this, the picture is first cropped to just the part we want, and then shrunk to the desired size (60x72). One catch is that the originals are so large that it's not practical to edit them on a typical screen, so we instead pick the "large" version to edit. E.g instead of the default of convert -geometry 60x90 -crop 60x72+0+0 \ source/wcwince.jpg ../thumb/wcwince.jpg it was better to use convert -crop 325x390+18+113 -geometry 60x72 \ ../large/wcwince.jpg ../thumb/wcwince.jpg Note that order of arguments matters. First it 'crops' (selects the part we want), and then shrinks. The parameters were obtained by first running: display ../large/wcwince.jpg and then: - left clicking on the picture to cause the main menu to appear, - selecting "transform" and then "crop", - left clicking on the desired upper left hand picture corner, - dragging the mouse to the desired lower right hand corner, - recording both the size and position of the cropped image, as displayed on the image, resulting in 256x390+52+113 in this case, - converting the aspect ratio of the result to the desired 60x72 size, by: height * 60/72 == width_to_use x_offset - (width_to_use - width)/2 == x_offset_to_use so in this case that's height = 390, width = 256, x_offset = 52 390 * 60/72 == 325 52 - (325 - 256)/2 == 18 to arrive at: 325x390+18+113 - and then running: convert -crop 325x390+18+113 -geometry 60x72 \ ../large/wcwince.jpg ../thumb/wcwince.jpg