[AccessD] DatePictureTaken property

Jurgen Welz jwelz at hotmail.com
Fri Aug 27 12:35:34 CDT 2010


Lambert:  I'm pretty happy with my implementation though it's not perfect.  Not every picture reveals a date taken property, but it doesn't in Windows Explorer either, and I've managed to crash the code from the link I used until I put in an 'On Error Resume Next' and a couple Error handlers.  I will simpllify it down a fair bit since I don't really need much of the functionality that came with it.

 

I had reviewed the vbaaccelerator.com information you linked as that site was one of a few hundred Google hits when I was searching for an API solution.   It was one of a few where there was awareness of the fact that the date taken and date created were separate properties.  My Terminal Server environment doesn't allow install, registration or use of the type library.


Ciao

Jürgen Welz

Edmonton, Alberta

jwelz at hotmail.com


 
> From: Lambert.Heenan at chartisinsurance.com
> To: accessd at databaseadvisors.com
> Date: Fri, 27 Aug 2010 09:13:52 -0400
> Subject: Re: [AccessD] DatePictureTaken property
> 
> Take a look here...
> 
> http://www.vbaccelerator.com/home/VB/Code/vbMedia/Using_GDI_Plus/Reading_EXIF_and_Other_Image_Properties/article.asp
> 
> Lambert 
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jurgen Welz
> Sent: Thursday, August 26, 2010 5:42 PM
> To: accessd at databaseadvisors.com
> Subject: [AccessD] DatePictureTaken property
> 
> 
> I've been writing a routine to allow indexing of photos of projects. I've had a bit of fun getting to the DatePictureTaken property. In our Windows Server 2003 environment, if we open a folder of photos, one of the columns that shows up is headed: Date Picture Taken. This is not the same as the Date Created or Date Modified properties. If I right click on a particular picture, I get the created date as Friday, June 27, 2008, 4:21:24 PM and the modified date as Wednesday, June 11, 2008, 1:25:44 PM. In this case, the modified date is the same as the date created, however, if the photo is edited, the modified date is no longer the same as the Date Picture Taken which continues to show the correct date in the column.
> 
> 
> 
> I was looking for ways to access the Date Picture Taken in VBA in order to auto organize the photos into weekly subfolders generated in code. As it stands, all our Project and Estimate photos are filed in a project or estimate specific folder but I was in need of a means to create a searchable index of many thousands of photos. For example, I want to be able to enter search criteria for a type of construction project (school, entry feature...) at a certain phase (bid, execution, complete, landscaped) including a person (employee name) and a category of equipment (scaffold, forklift) being used correctly (safe use). Since the photos are already filed by project, any search parameters for type of material or type of construction can be keyed on the project primary key. The fun part was to build a form interface that can be used to go through the photos, one by one, and flag them for input by project manager, safety, equipment and to enter parameters and notes that will be stored in a table. The next step was to create a search form that provides several dozen searchable parameters to filter results. The last step was a copy to folder procedure that copied all matches to a single folder to work with results.
> 
> 
> 
> To make this work, no file names are allowed to be changed in the file system directly. All file name changes must be made via the form interface since otherwise the files would be lost to the system as the path and name of each file is a table stored attribute uniquely identifying each photo but it is very helpful to make names resonably descriptive so they make sense in explorer view. Any change to the name or path not reflected in the table means the picture is functionally lost and any of the metadata stored in the table is wasted. To keep things as simple as possible, it is necessary to make the paths somehow deterministic hence the Date Picture Taken concept that allows us to file photos within Project, estimate, employee, contact and equipment paths by year\week and to make it easy to see the chronology of progress or wear and tear on equipment.
> 
> 
> 
> The problem was how to get to the DatePictureTaken property. If it shows in Explorer, you'd think it should show up in the FileSystemObject and I even set a reference to the MS Scripting Runtime library to have a look. VBA gives no direct access and several google searches took me to 'solutions' that confuse the date created with date taken properties. I did find one place that gave me a class I could copy and paste into a new class in Access. I had to comment out the first 8 lines as they aren't VBA compatible and move the option explicit to the top, but after that, no problem writing the code to move all JPG files to annual and week number folders within the respective project, employee, equipment etc where each record is maintained in a numeric primary key folder. Now to get the worker bees to update the metadata on several 10s of thousands of photos. The photo form interface opened from each type of form record has a simple next - prev picture command button and next - prev folder button that enable and disable just like the navigation buttons do for records in a typical access form. The only thing I should still probably add is a routine that flags photos that haven't had the attributes added for newly uploaded pictures and existing photos that haven't yet been reviewed.
> 
> 
> 
> The other thing I'm going to need to deal with is cameras that are not correctly set for date and flag those files that are dated out side the project start and end date range. We do have photos of finished projects taken years after completion but it would make sense to have them flagged for review any way. With the new system in place, this type of discrepancy will be quickly identified and remedied.
> 
> Ciao
> 
> Jürgen Welz
> 
> Edmonton, Alberta
> 
> jwelz at hotmail.com 		 	   		  


More information about the AccessD mailing list