none
How can I get properties from the "Details" tab of a jpg file? RRS feed

  • Question

  • From Powershell, I wish to retrieve the "Comments" field for a jpg file.

    I have installed the Powershell Pack and used its imaging cmdlets to access other EXIF properties.  But, the Comments field does not appear in those tools (that I could find anyway).

    Since I can view and edit the Comments field for jpg right from Explorer, I'm guessing there must be some generic way of getting access to it.  I don't want to change the value, just read it.

    Tips and suggestions appreciated.  Thanks.

    Saturday, September 8, 2012 5:36 AM

Answers

  • Thanks jrv, that was helpful.  It led me to a solution - although it took some doing.

    The Powershell Image module you linked to is terrific - a great add-on to the Powershell Pack.

    But, it's "get EXIF" cmdlets don't, by default, extract the Comments stream I wanted.  Apparently, there are two EXIF "comment" tags and, by default, it extracts the other one.  I was able to use the Image "get exif" cmdlet to get it, but had to identify the comment tag manually like this:

        $jpg = get-image c:\pics\myfile.jpg
    
        $comments = get-exifitem -image $jpg -exifID 40092

    Just for reference, the exif ID of the other comment tag field is 37510.  Symbolic references for various exif fields are found in the get-exif.ps1 script in its install directory.

    Thanks for leading me to the solution.

    • Marked as answer by wartmac Saturday, September 8, 2012 8:15 PM
    Saturday, September 8, 2012 8:15 PM

All replies

  • Thanks jrv, that was helpful.  It led me to a solution - although it took some doing.

    The Powershell Image module you linked to is terrific - a great add-on to the Powershell Pack.

    But, it's "get EXIF" cmdlets don't, by default, extract the Comments stream I wanted.  Apparently, there are two EXIF "comment" tags and, by default, it extracts the other one.  I was able to use the Image "get exif" cmdlet to get it, but had to identify the comment tag manually like this:

        $jpg = get-image c:\pics\myfile.jpg
    
        $comments = get-exifitem -image $jpg -exifID 40092

    Just for reference, the exif ID of the other comment tag field is 37510.  Symbolic references for various exif fields are found in the get-exif.ps1 script in its install directory.

    Thanks for leading me to the solution.

    • Marked as answer by wartmac Saturday, September 8, 2012 8:15 PM
    Saturday, September 8, 2012 8:15 PM
  • Yes - I am aware of teh EXIF ids.  They are mostly proprietary to different image formats and format extensions.  The movie industry and photo industry have defined many.  The complete catalog has thousands of references and methods for detecting which catalog is being used.

    EXIF is slowly being replaced by XMP which is much more flexible.

    Here is a good overview of EXIF and how it has evolved. http://en.wikipedia.org/wiki/Exchangeable_image_file_format

    I posted a link t the repository because there is really no simple answer to the question you asked.  There is no one "comment" as you have found.  You can only use the tool and try to look up or discover the ID of the tag you want.  The tool box allows you to search through all tags and display them per image if need be.


    ¯\_(ツ)_/¯

    Saturday, September 8, 2012 9:31 PM