Berkeley CSUA MOTD:Entry 41383
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/07/09 [General] UID:1000 Activity:popular
7/9     

2006/1/15-17 [Computer/SW/Languages/Perl, Computer/SW/Languages/Misc] UID:41383 Activity:high
1/15    This is a computer question which photo geeks would appreciate.
        I am trying to
           extract date/time from JPEG's EXIF header and use that to
           override Windows/NTFS's filename's create time.   I need to
           do this in a batch mode involves hundreds of photographs.
           How to do this?  write a shell script in cygwin?  which library
           do you recommend to extract EXIF header?  how to modify ctime on
           NTFS?   thanks.                      kngharv
           \- i dont know anything about the windows side but i use "jhead"
              [http://www.sentex.net/~mwandel/jhead/] or tcl. ok tnx. --psb
              \_ thanks.  jhead fits that part of my need.  However, I am
                 also looking for something where I can add a field to
                 EXIF, namely "FocusLengthIn35mm."  If any of you guys
                 knows how to do this, please let me know.   OP
                 \_ Image::ExifTool --dbushong
           \_ http://jpgtime.learsy.com i've used it to change the time stamps,
              not sure if it can add other exif data
        \_ Since the beginning of my digital camera days, I've adopted
           the policy of renaming my digital camera images
           YYYYMMDD_HHMMSS_NNNN[_tag].jpg (where NNNN is the sequence
           number and tag can be the camera model). The time a picture
           was taken is more important to me than all the other
           attributes, and name my files this way make sure that
           information will not be lost and every file has a unique
           identification. I use my own perl script to do this, but I
           am sure you can find utilities that does rename for you. My
           script can also re-touches file timestamp based on the time
           embedded in the filename, so I can very easily adjust the
           file timestamp if necessary. The important thing is to make
           sure your camera's clock is set correctly (for the timezone
           you are in), but my script has an offset option for those
           "ops" occasions. On my last trip we used 2 cameras, and the
           file ordering allows me to dump the pictures from both
           cameras together and do slide shows in the order the
           pictures were taken across both cameras. Email me if you
           want to give it a try. -chiry
           \_ I didn't agree with "The time a picture was taken is more
              important to me than all the other attributes" until I became a
              parent.  When other people see my baby's pictures, the first
              question they ask is nearly always "how old was he?".  For those
              pictures without imprinted dates, I quite often find myself
              unable to answer.
              pictures without imprinted dates, I usually find myself unable to
              answer.
           \_ unfortunately, the reason why I've asked this question at
              first place is that I am still using 35mm and other film cameras.
              and they don't have EXIF info :p
         \_ might be a bit overkill, but these should be able to do what
            you want:
            http://www.luminous-landscape.com/reviews/software/asset-management.shtml
2025/07/09 [General] UID:1000 Activity:popular
7/9     

You may also be interested in these entries...
2012/4/27-6/4 [Computer/SW/Languages/Misc, Computer/SW/Unix] UID:54372 Activity:nil
4/27    I wrote a little shell script to collect iostat data:
        #!/bin/bash
        DATE=`date +%m%d`
        DATADIR=/var/tmp/user
        OUTPUTFILE=$DATADIR/$DATE.out
        while true
	...
2012/5/8-6/4 [Computer/SW/Unix] UID:54383 Activity:nil
5/8     Hello everyone!  This is Josh Hawn, CSUA Tech VP for Spring 2012.
        About 2 weeks ago, someone brought to my attention that our script
        to periodically merge /etc/motd.public into /etc/motd wasn't
        running.  When I looked into it, the cron daemon was running, but
        there hadn't been any root activity in the log since April 7th.  I
        looked into it for a while, but got lost in other things I was
	...
2011/10/26-12/6 [Computer/SW/Unix] UID:54202 Activity:nil
10/24  What's an easy way to see if say column 3 of a file matches a list of
       expressions in a file? Basically I want to combine "grep -f <file>"
       to store the patterns and awk's $3 ~ /(AAA|BBB|CCC)/ ... I realize
       I can do this with "egrep -f " and use regexp instead of strings, but
       was wondering if there was some magic way to do this.
       \_ UNIX has no magic. Make a shell script to produce the ask or egrep
	...
2011/7/30-8/10 [Computer/SW/Languages/Misc] UID:54148 Activity:nil 66%like:54150
7/29    Happy Sysadmin Day
        \_ our "sysadmin" today deleted /home. When we asked her why
           she said she didn't do it. When I checked the sudo logs,
           I found these two commands in order:
               COMMAND=/bin/rm -r /home testuser
               COMMAND=/bin/rm -r /home/testuser
	...
2011/5/19-7/13 [Computer/SW/Languages/Misc] UID:54115 Activity:nil
5/19    If script A runs, and calls script B ..... is it possible for me to exit\
        script A based on results of script B and not continue?
        \_ assume any shell
        \_ Yes.
           \_ without passing the result to some stupid temp file?
              \_ It sounds like you want "scriptb || exit", which will run
	...
2010/4/22-5/10 [Computer/SW/Languages/Misc] UID:53797 Activity:nil
4/22    In Linux is there an easy way to rename the scripts in /etc/rc?.d ?
        For example I want to set all the /etc/rc?.d/S91apache to S100apache
        so that it'll run the ramdisk BEFORE going to apache.
        \_ Sure, just move them.
           \_ I mean is there a script that will rename all of them
              for me? Like: setrc apache2 0 0 1 1 1 1
	...
2009/10/27-11/3 [Computer/SW/Unix] UID:53475 Activity:nil
10/27   http://www.maxgames.com/play/flash-mind-reader.html
        how does this work?
        \_ sh -c 'for ((i=0;i<10;i++)); do for ((j=0;j<10;j++)); do echo "$i$j-(\
$i+$j)" | bc; done ; done' | uniq
        \_ bash -c 'for ((i=0;i<10;i++)); do for ((j=0;j<10;j++)); do echo "$i$j\
-($i+$j)" | bc; done ; done' | uniq
	...
2009/10/1-22 [Computer/Companies/Google, Academia/Berkeley/CSUA/Motd] UID:53424 Activity:kinda low
10/1    google wave is a really fancy version of wall.  i can pipe
        giant ascii text files through it.  my dream has come true.
        does anyone remember when jwang made it so if you walled
        embedded html tags, it would appear in the csua lwall www page?
        google wave is a little better than that. - danh
        \_ http://www.techcrunch.com/2009/10/09/google-wave-is-easier-to-understand-than
	...
2009/8/19-9/1 [Computer/SW/Unix] UID:53285 Activity:nil
8/18    Hi again, new freebsd guy here again, in bash I was able to go
        LD_LIBRARY_PATH=/opt/foo/lib ./runmyapp
        I managed to do this in tcsh by using setenv in a shell script
        that setenv's the lib path and then executes $1, just wondering
        if there was a way to do it in 1 line from the cmd line as in bash?
        Thanks, btw %2c or %3c worked.  Freebsd, tcsh and vi forever!
	...
Cache (73 bytes)
www.sentex.net/~mwandel/jhead/]
Not Found The requested URL /mwandel/jhead/ was not found on this server.
Cache (8192 bytes)
www.luminous-landscape.com/reviews/software/asset-management.shtml
Some shoot just a handful of frames every now and then, while others return from distant lands with Gigabytes of data and thousands of images. Their needs therefore differ greatly when it comes to how they transfer, review, catalogue and organize their files. Professional photographers also need to ensure that all of their files are well annotated using the IPTC fields, with copyright information and extensive keywording so that images can be easily identified and retrieved. There are currently (December, 2005) two programs which stand out for me, and which have been embraced by professional photographers. These are by no means the only programs in their fields, and many would argue for other contenders. But, if you sit down with working photographers and glance over their shoulders as they work on location with their laptops, or in their studios, these two programs are more often than not the ones that are in use. Both of these programs have been on the market for several years. Both are now mature offerings, and have been reviewed extensively online and in print. A quick search here on the web will turn up any number of salient reviews and commentaries. Also, both programs are available for extended free trials, and are available for download. And yes, both are available for Windows and Mac OSX platforms. So here then is a quick look at the capabilities of each of these two programs and a few words on how I use them. You may want to consider where they might fit into your workflow. Photo Mechanic 4x from Camera Bits (Windows and OS X versions available). It has been around for several years, and for many photographers has become an indispensable part of their workflow. Let's make clear what Photo Mechanic is (PM from now on), and is not. It is primarily a file "ingest" and sorting and key-wording program. It is not a cataloging program, and it is not a raw converter. Seems like limited functionality for a lot of money, doesn't it? But that snap judgment would miss the strengths and benefits of this unique program. Since PM is available for a free full-featured download which lasts for 20 days, you can easily discover for yourself whether its capabilities are a match to your particular needs. But, here's a brief overview of what the program does - because in some cases its capabilities are unique. Ingesting If PM is open when a card is placed into a reader, like many programs of its type it will ask whether you want to "ingest" the files. Firstly, you can copy files to two different destinations simultaneously, and these can be on two different drives. When I'm working on location I always copy my cards to two separate portable Firewire drives, and these drives are stored and carried separately until I get back to my office. Brain fade happens - like leaving my briefcase by the curb as I get into a cab at the airport after a 24 hour flight from half-way round the world (which I've done). Prior to working with PM I would end my day on location by having to copy the day's files from one hard disk to another. Now it happens automatically without extra thought or time. Remarkably, if you have more than one card reader, you can even ingest multiple cards simultaneously, and in a stroke of grace, have PM auto-unmount the cards when done. You also can set the program to get rid of those annoying DCIM / Camera Name directories that make wading through files after a long shoot so tedious. Just import all files directly into a newly named directory with all subdirectories automatically eliminated. For working pros, the ability to create IPTC Stationary, and have it automatically attached to ones files, is a godsend. You're probably familiar with the camera's Metadata, or EXIF information - the text that is embedded in each JPG or raw file that tells you what camera was used, what lens, what exposure, etc. But there are also Metadata fields called IPTC which can contain user data, such as the photographer's name and address, copyright notice, keywords for later retrieval, ranking information, and the like. Most amateurs don't bother filling these in, because it can be a time consuming job, and for some unnecessary. With it you can create what they call IPTC Stationary, which is a template that you can fill in and then automatically attach to each file as its ingested from the memory card to your hard drive. There are numerous fields, each of which can be turned on and off, and each of which can have multiple selections available from drop-down menus. Many of the fields available will only be of need to photojournalists and stock photographers who need to caption their work rigorously. But even a casual photographer will appreciate having their name and copyright information imbedded in each of their files, and also some location data and keywords to aid later retrieval. But this capability is not just limited to files as they are ingested. Simply set up your IPTC Stationary Pad with whatever information you wish, select the files required at any time, and then click on the Apply Stationery to Selected button. PM is one of the fastest programs around for adding metadata to your existing files. It can do hundreds of files in a directory in just a few seconds. If ingesting files from a memory card and applying user-defined metadata was all that PM did, it would be worthwhile. More than anything else PM is the world champion for speed when it comes to viewing and sorting files, including virtually every type of raw file. And just as we used to sort slides on a lightbox with coloured pen dots placed on the cardboard mounts, so too can you mark files with coloured tags and then sort them accordingly. This is much the same capability as Adobe Bridge and Apple's Aperture have adopted, except regrettably the labeling data is not compatible or transferable. Also, to my regret, PM lacks a 1-5 ranking system similar to that in Adobe Bridge or Iview Media Pro. Though it is not a file editor or raw converter PM allows you to rotate and crop images. These commands are recorded in the file as tags or as sidecar files, depending on the camera type. PM's great strength is that it shows file thumbnails quickly (even raw files) - almost as quickly as one can scroll down the screen. The secret is that it sucks the imbedded JPG out of the raw file and then when you want to view the image full screen or larger it processes the raw file to allow this. Though it can read raw files, and enlarge them onscreen, it has no raw conversion capability. It therefore has to make no attempt to "interpret" or auto correct the raw file. It simply takes the embedded camera settings and applies them. A raw conversion program such as Adobe Camera Raw has to do much more, and that's why loading a hundred or more raw files into ACR and watching them appear can be quite tedious, while with PM it's almost instantanious Summary There are a number of other capabilities in PM that are of particular use to photojournalists, such as the ability to FTP files directly from within the program. If you need these, you're likely already using Photo Mechanic. If not, the free unrestricted 20 day trial will allow you to explore the program and see which ones make sense for you. There is almost a cult following of PM among photojournalists and stock photographers. It's accelerated workflow and superior file ingesting capability have made it a favourite, and few if any programs are as adept when it comes to captioning and keyword tagging using IPTC fields. It also is constantly evolving, with support for new raw camera formats added almost as quickly as they appear. The developers also seem to be very attentive to user feedback for new features and bug fixes. If it were less than $50 I would suggest that it should be in every photographers arsenal. But at $150, and especially now that Adobe Bridge has largely comparable tagging and categorizing capabilities, it might be a tough sell. But for those that need its speed and features, Photo Mechanic is still almost a must-have. And with Version 3 (called IV3 from hereon), many of the capabilities of Photo Mechanic are now matched, and in some cases superce...
Cache (3465 bytes)
jpgtime.learsy.com
MuralPix Time Stamp Modifier for JPEG Files The program enables to set the file time stamp (ie date and time) from the EXIF date/time and also enables to shift the time stamp of multiple files. For synchronizing time stamps of files from multiple digital cameras. With a group of our friends we usually rent a big chalet for one week holidays. Last year we have found a beautiful one, in mountains, far away from the nearest village... important is the fact that we had there two digital cameras and made a lot of snaps while enjoying the travels in the nature. After the holidays I got a task to put images from both digital cameras to a CD and copy it for all friends. So I have put the images from both cameras to single folder, set ascending sorting by date/time in my old-but-still-good ACDSee 30 and enjoyed viewing the photos - sorted by time stamp they fitted together wonderfully, like a LEGO. However, as I have found later, this was only an exceptional case. But unfortunately simple sorting by time stamp did not work this time. As a result, I had to change the time stamp on more than 3/4 of all the photos, the number of which was over 700! After unsuccessful looking for some software which would help me with this task I have decided to write my own. It enables to get the time from the EXIF info (stored inside by the JPEG file) and set it as the time of the file. It also enables to select multiple files in a list and shift their date/time by a time slice - by single click you can increase/decrease seconds, minutes, hours, days, months or years. Unfortunately for the case there is no other solution, than to estimate somehow, when the snap was actually made and then set this time manually. How to use the program Before merging the snaps from different cameras into a single folder, it is better to leave them for the moment in separate folders, ie snaps from each camera in its own folder. Fixing the case * Select the folder by the "Select folder" button and sort the files by file date/time by clicking in the header of the Original time column. Fixing the cases and These two cases are identical in principle - you need to shift the time by the same time slice on all the selected images. On some types of events it is necessary to synchronize the images with a one-second precision. the first matrimonial kiss of the engaged couple was pretty short event (few seconds), but fortunately was also the event everybody was shooting, so such snaps then served very well as reference snaps. it only displays this file date/time stamp permanently in the toolbar so you are now free to select another folder with images from another camera. Click on the time modifying buttons (with arrows) so that the reference snap 2 will get the same time as the reference snap 1 All the selected images will be shifted by the same amount of time, so this action will synchronize the images with the first camera. Fixing the case If the image contains no information about its time, neither in its file time stamp, nor in the internal EXIF info, then you must guess its date/time. The most comfortable way how to do so it the following: * Merge the files from various camera to single folder before proceeding. When you find the place, you can estimate the date/time needed to be set. Select the same folder (ie do not change the folder) and press OK. Now you can check if the file is placed on the proper position (files need to be sorted by original time).