locked
Re: Use PowerShell to Find Metadata from Photograph Files RRS feed

  • Question

  • Hi,

    Just read the new blog and thought i'd try it.

    I got as far as setting and calling the $picMetaData for a folder. It didn't list anything when i just has a TIF file in there but when i created a jpg version of the same file it listed the details of both. Tried deleting the jpg and back to no listing. Apologies if i'm missing something as a Powershell lightweight

    It might be worth mentioning that the original file was a georeferenced TIF but if it is relevant, it seems odd that it returned a listing when the jpeg version was present.

    Apologies also for asking this on the blog - i realise i should have come here first.

    Andy

    Thursday, February 6, 2014 1:40 PM

Answers

  • Here is a version that works for one folder and produces consistent CSV files.  It only enumerates the first 66 tags but that covers 99% of all tags.

    You have to understand that each folder will have different metadata.  Thi is determined by the folder contents.  When we ask for GetDetailsOf the folder object the shell scans the files and merges all metadata into the results.  If we scan a different folder we will not likely find data names that match.  Much of this is determined by the providers that are installed to the shell.

    The code will also list all files and not just image files.  We could put in a filter using Get-ChildItem.

    Here is the code: http://sdrv.ms/1gQr1B8


    ¯\_(ツ)_/¯

    • Marked as answer by AndySpatial Wednesday, February 12, 2014 10:52 AM
    Thursday, February 6, 2014 5:51 PM

All replies

  • The blog code has numerous errors in its logic.  When you convert a TIFF to a JPG the tags (EXIF)are reassigned to the JPG.  The TIFF tagging conventions are similar but not identical.  The conversion routine can reassign these much of the time.

    I have a better version of the metadata lister which I will try to find.  This one lists ragged data to the CSV which can cause issues. It looks like that if the first file has no metadata then all future files will not show metadata.  This is a residue of the CSV creation.


    ¯\_(ツ)_/¯

    Thursday, February 6, 2014 3:12 PM
  • Here is a version that works for one folder and produces consistent CSV files.  It only enumerates the first 66 tags but that covers 99% of all tags.

    You have to understand that each folder will have different metadata.  Thi is determined by the folder contents.  When we ask for GetDetailsOf the folder object the shell scans the files and merges all metadata into the results.  If we scan a different folder we will not likely find data names that match.  Much of this is determined by the providers that are installed to the shell.

    The code will also list all files and not just image files.  We could put in a filter using Get-ChildItem.

    Here is the code: http://sdrv.ms/1gQr1B8


    ¯\_(ツ)_/¯

    • Marked as answer by AndySpatial Wednesday, February 12, 2014 10:52 AM
    Thursday, February 6, 2014 5:51 PM
  • Thanks jrv, i'll endeavour to use and hopefully understand this! Much appreciate your time searching out the information and apologies for not responding more rapidly
    Wednesday, February 12, 2014 10:52 AM