none
Extracting Photoshop Elements data through EXIF PhotoshopSettings = &H8649 RRS feed

  • Question

  • I can see the Photoshop Elements tags that I created for a given image using Microsoft file explorer->properties->details. They are shown as values opposite the "Tags" property.  I currently use a package called ExifWorks.vb that I got through MSDN to extract image EXIF properties.  I want to modify this software to add the Photoshop Elements tags.  The EXIF tag in question is PhotoshopSettings = &H8649. Has anyone done this?

    RONATMOODYLAKE

    Monday, March 19, 2018 3:51 PM

Answers

  • Please consider the attached file.  It has the data that Microsoft file explorer->properties->details shows.

    RONATMOODYLAKE

     The below code is something I wrote a while back and it seems to list the properties you want I think.  It shows the 3 star Rating,  plus several others.  It lists the same file properties that the explorer window does.  It might help get you going?

    ' You must also add a reference to (Microsoft Shell Controls And Automation) on the (Com) tab of the Add Reference dialog window.
    
    Public Class Form1
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            ShowFileInfo("C:\Users\User1234\Pictures\Exif Orientation Data Jpg\1242932.jpg")
        End Sub
    
        Private Sub ShowFileInfo(filename As String)
            Dim FolderPath As String = filename.Remove(filename.LastIndexOf("\"))
            Dim ShellInterface As New Shell32.Shell
            Dim Sh32Fldr As Shell32.Folder = ShellInterface.NameSpace(FolderPath)
    
            'this gets the Name and Index of each property that the explorer window commonly shows for each type of file.
            'once you know the index of the property names you want, you can just eliminate this loop an use a list of the index numbers in the loop below this one.
            Dim PropNames As New Dictionary(Of Integer, String)
            Dim pName As String = ""
            For i As Integer = 0 To 350
                pName = Sh32Fldr.GetDetailsOf(Sh32Fldr.Items, i)
                If pName IsNot Nothing AndAlso pName.Trim <> "" Then PropNames.Add(i, pName)
            Next
    
            'here is where it finds the specified file and gets any properties that are not null or empty for the file
            Dim sb As New System.Text.StringBuilder
            For Each itm As Shell32.FolderItem In Sh32Fldr.Items
                If itm.Name.ToLower = IO.Path.GetFileName(filename).ToLower Then
                    For Each kvp As KeyValuePair(Of Integer, String) In PropNames
                        Dim propval As String = Sh32Fldr.GetDetailsOf(Sh32Fldr.ParseName(itm.Name), kvp.Key)
                        If propval.Trim <> "" Then sb.AppendLine((kvp.Value & ":").PadRight(22, " "c) & propval)
                    Next
                End If
            Next
            RichTextBox1.Text = sb.ToString
    
            System.Runtime.InteropServices.Marshal.ReleaseComObject(Sh32Fldr)
            System.Runtime.InteropServices.Marshal.ReleaseComObject(ShellInterface)
            ShellInterface = Nothing
            Sh32Fldr = Nothing
        End Sub
    End Class

     

     I saved the image you posted to my computer and the below image shows the property info I get for it.


    If you say it can`t be done then i`ll try it

    • Edited by IronRazerz Thursday, March 22, 2018 12:53 AM
    • Proposed as answer by Mr. Monkeyboy Thursday, March 22, 2018 1:16 AM
    • Marked as answer by RONATMOODYLAKE Thursday, March 22, 2018 9:02 PM
    Thursday, March 22, 2018 12:28 AM
  • I replied to your previous post before I read this one - sorry. It looks like your code worked.  I will give it a try.  I have thousands of photos like the example and working out this problem opens up a new vista for me.

    RONATMOODYLAKE


    Also you said you want to Set a value didn't you? That's why I asked Razerz if there is a Set and not only a Get ability. Razer knows this stuff inside and out and I suppose Castorix31 does too being a C++ person.

    La vida loca

    Thursday, March 22, 2018 1:38 AM

All replies

  • No. I suspect you should review links from this google search for EXIF Works MSDN. Various results appear like they may be able to assist you possibly (that's how the intel community writes to keep from being specific so they won't be wrong but may be right LOL "May be able", "Possibly").....

    La vida loca

    Wednesday, March 21, 2018 2:04 AM
  • I currently use a package called ExifWorks.vb that I got through MSDN to extract image EXIF properties.  I want to modify this software to add the Photoshop Elements tags.  The EXIF tag in question is PhotoshopSettings = &H8649.

    Modifying ExifWorks is not difficult - it is set up to match the extensible nature of the tags.  But you will need to know the data type of the new tag, because you need to specify the type when you add the tag to the collection of tags that ExifWorks understands.    If it is a custom type (which is unlikely) then the process gets more complex. Photoshop might document the tag for you, or you might have to guess the type from the Explorer details.  Once you know the details of the tag just add it to the list and it becomes accessible.

    Wednesday, March 21, 2018 2:36 AM
  • I am comfortable modifying ExifWorks.  My frustration is finding the Photoshop Elements tag information. I know that it can be extracted because the Microsoft file explorer exposes the Photoshop Elements captions, image ratings (one to five stars), and custom tags (ASCII text) that I have created.  I just cannot seem to find out how to access this data.  The Photoshop Elements metadata that it exposes do not show the data (as metadata) that the Microsoft file explorer shows so I cannot find the EXIF tags related to it.  I have been interested in doing this for over a year.  I have not found any clues from The Photoshop Elements support sites or forums that I have searched.  I thing that Photoshop Elements is a trusted member of the Microsoft community so these details should be of interest to MSDN. Maybe this dialog will spark some more interest. I will not give up yet!

    RONATMOODYLAKE

    Wednesday, March 21, 2018 12:59 PM
  • I know that it can be extracted because the Microsoft file explorer exposes the Photoshop Elements captions, image ratings (one to five stars)

    On my OS, the Shell (Microsoft Shell Controls and Automation) gives the stars in a property called "Notation" (Folder2.GetDetailsOf), but I don't know if it's what you're talking about...


    • Proposed as answer by Mr. Monkeyboy Thursday, March 22, 2018 1:17 AM
    Wednesday, March 21, 2018 3:49 PM
  • Thanks for that, but my main interest is in the image tags.  A given image may contain tags that I have defined,such as "leopard, Tanzania, Serengeti", etc.  These tags are essential when creating custom slide shows (not using Photoshop Elements).

    RONATMOODYLAKE

    Wednesday, March 21, 2018 4:19 PM
  • And they don't appear if you display the properties in a loop ?
    Wednesday, March 21, 2018 5:14 PM
  • I don't follow.  How can I display the properties in a loop?  Using Photoshop Elements? I can see all (or most of) the relevant EXIF data using Photoshop Elements.

    RONATMOODYLAKE

    Wednesday, March 21, 2018 8:06 PM
  • I don't follow.   You have stated "The EXIF tag in question is PhotoshopSettings = &H8649" and "I am comfortable modifying ExifWorks".  So why don't you modify ExifWorks to display tag &H8649? 

    Or is the problem that you have successfully modified the images to include your custom tags, but they aren't accessible from within Photoshop?   Whether or not any application accesses specific tags is dependent on the application - if it's not coded to display that tag then it won't display.

    I can't tell if you are trying to write an application in VB to create and use tags, or if you are complaining that Photoshop doesn't do what you want it to do.

     
    Wednesday, March 21, 2018 9:07 PM
  • I don't follow.  How can I display the properties in a loop?  Using Photoshop Elements? I can see all (or most of) the relevant EXIF data using Photoshop Elements.

    RONATMOODYLAKE

            Dim image As Image = New Bitmap(FileName)
                Dim propItems() As PropertyItem = image.PropertyItems
            For Each propItem As PropertyItem In propItems
                'this is where you get the ID, Type, value - requires System.Drawing.Imaging
            Next propItem

    This does not use any 3rd party tools. I cant find any images with that Tag ID so I don't know what I am looking for.

    Wednesday, March 21, 2018 10:03 PM
  • The tag at H8649 displays nothing, so that is not the path to the data.  I have not modified any of the images in question.  The data I seek is embedded in the images. It shows using the Microsoft file explorer.  Photoshop Elements shows some EXIF data, but the EXIF data that it shows does not include the image tags that in want. I am not trying to write an application in VB to create and use these tags.  They are already in the image. The Microsoft file explorer shows them. I simply want to get at them using modifications to ExifWorks, but I have found no information showing how to find them. If the Internet explorer can display them, then there must be some way for me to display them also. I hope that explanation c clear.

    RONATMOODYLAKE

    Wednesday, March 21, 2018 10:04 PM
  • I don't follow.  How can I display the properties in a loop?  Using Photoshop Elements? I can see all (or most of) the relevant EXIF data using Photoshop Elements.

    As I said, with Folder2.GetDetailsOf (from Folder2.ParseName)

    But in fact Explorer->properties->details uses IWICMetadataQueryReader

    (GetMetadataByName with /app1/ifd/exif/{ushort=value})

    It is easier in C++ (WICExplorer)

    (you can find C# code on Google and maybe VB.NET...)



    • Edited by Castorix31 Wednesday, March 21, 2018 10:30 PM
    Wednesday, March 21, 2018 10:07 PM
  • The tag at H8649 displays nothing, so that is not the path to the data.

    If you have modified ExifWorks to display tag &H8649 and you get no display for an image that includes that tag, then you need to debug your modification to ExifWorks.  You need to first find if the tag is being found in the image, and then step the code through to see what data is extracted, and discover why nothing is displayed.  If the tag is not being found in the image you need to determine why.

    Wednesday, March 21, 2018 10:12 PM
  • I misled you.  The ONLY reason that I even pursued the tag at H8649 is because I looked at the ENTIRE specification (http://www.exiv2.org/tags.html) and the only mention of photoshop was for tag 0x8649.  That led me nowhere.

    RONATMOODYLAKE

    Wednesday, March 21, 2018 10:47 PM
  • The ONLY reason that I even pursued the tag at H8649 is because I looked at the ENTIRE specification (http://www.exiv2.org/tags.html) and the only mention of photoshop was for tag 0x8649.

    So is the problem that you can see that the information is in the file, but you cannot identify what tag is needed to get at that information using ExifWorks?

    Wednesday, March 21, 2018 11:08 PM
  • Please consider the attached file.  It has the data that Microsoft file explorer->properties->details shows.

    RONATMOODYLAKE

    Wednesday, March 21, 2018 11:21 PM
  • Please consider the attached file.  It has the data that Microsoft file explorer->properties->details shows.

    So that is the image that you are working from.   Is the problem with that image that it contains some information which you are not able to extract using your modified version of ExifWorks?  If so, what is the information, and what is the code you are using to extract it?  If that's not the problem, what is?

    Thursday, March 22, 2018 12:02 AM
  • Please consider the attached file.  It has the data that Microsoft file explorer->properties->details shows.

    RONATMOODYLAKE

     The below code is something I wrote a while back and it seems to list the properties you want I think.  It shows the 3 star Rating,  plus several others.  It lists the same file properties that the explorer window does.  It might help get you going?

    ' You must also add a reference to (Microsoft Shell Controls And Automation) on the (Com) tab of the Add Reference dialog window.
    
    Public Class Form1
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            ShowFileInfo("C:\Users\User1234\Pictures\Exif Orientation Data Jpg\1242932.jpg")
        End Sub
    
        Private Sub ShowFileInfo(filename As String)
            Dim FolderPath As String = filename.Remove(filename.LastIndexOf("\"))
            Dim ShellInterface As New Shell32.Shell
            Dim Sh32Fldr As Shell32.Folder = ShellInterface.NameSpace(FolderPath)
    
            'this gets the Name and Index of each property that the explorer window commonly shows for each type of file.
            'once you know the index of the property names you want, you can just eliminate this loop an use a list of the index numbers in the loop below this one.
            Dim PropNames As New Dictionary(Of Integer, String)
            Dim pName As String = ""
            For i As Integer = 0 To 350
                pName = Sh32Fldr.GetDetailsOf(Sh32Fldr.Items, i)
                If pName IsNot Nothing AndAlso pName.Trim <> "" Then PropNames.Add(i, pName)
            Next
    
            'here is where it finds the specified file and gets any properties that are not null or empty for the file
            Dim sb As New System.Text.StringBuilder
            For Each itm As Shell32.FolderItem In Sh32Fldr.Items
                If itm.Name.ToLower = IO.Path.GetFileName(filename).ToLower Then
                    For Each kvp As KeyValuePair(Of Integer, String) In PropNames
                        Dim propval As String = Sh32Fldr.GetDetailsOf(Sh32Fldr.ParseName(itm.Name), kvp.Key)
                        If propval.Trim <> "" Then sb.AppendLine((kvp.Value & ":").PadRight(22, " "c) & propval)
                    Next
                End If
            Next
            RichTextBox1.Text = sb.ToString
    
            System.Runtime.InteropServices.Marshal.ReleaseComObject(Sh32Fldr)
            System.Runtime.InteropServices.Marshal.ReleaseComObject(ShellInterface)
            ShellInterface = Nothing
            Sh32Fldr = Nothing
        End Sub
    End Class

     

     I saved the image you posted to my computer and the below image shows the property info I get for it.


    If you say it can`t be done then i`ll try it

    • Edited by IronRazerz Thursday, March 22, 2018 12:53 AM
    • Proposed as answer by Mr. Monkeyboy Thursday, March 22, 2018 1:16 AM
    • Marked as answer by RONATMOODYLAKE Thursday, March 22, 2018 9:02 PM
    Thursday, March 22, 2018 12:28 AM
  • Hey Razerz, is there a Sh32Fldr.SetDetailsOf instead of GetDetailsOf?

    La vida loca

    Thursday, March 22, 2018 1:23 AM
  • I have explained this repeatedly. Here it is again. The problem is NOT that I cannot modify ExifWorks. The problem is that I cannot find out where the data resides in the .jpg file. Did you use Microsoft file explorer->properties->details to show the properties in the attached file? Did you see the following items in the properties window: Tags - Grant's Gazelle; Tanzania; Arusha; Ngorongoro Crater; Ngorongoro;?

    Those items were put there by Photoshop Elements. I did not write software to put them in the .jpg file, so where in the .jpg file are they? Are they in some proprietary un-documented EXIF elements? If not, where did Microsoft Explorer get them?

    I hope you can see this data in the explorer as I have explained.  If not, I do not know how to communicate this problem effectively.

     

    RONATMOODYLAKE

    Thursday, March 22, 2018 1:27 AM
  • I replied to your previous post before I read this one - sorry. It looks like your code worked.  I will give it a try.  I have thousands of photos like the example and working out this problem opens up a new vista for me.

    RONATMOODYLAKE

    Thursday, March 22, 2018 1:31 AM
  • I replied to your previous post before I read this one - sorry. It looks like your code worked.  I will give it a try.  I have thousands of photos like the example and working out this problem opens up a new vista for me.

    RONATMOODYLAKE


    Also you said you want to Set a value didn't you? That's why I asked Razerz if there is a Set and not only a Get ability. Razer knows this stuff inside and out and I suppose Castorix31 does too being a C++ person.

    La vida loca

    Thursday, March 22, 2018 1:38 AM
  • The problem is NOT that I cannot modify ExifWorks. The problem is that I cannot find out where the data resides in the .jpg file.

    I think you are saying the Photoshop put the data there, even though Photoshop doesn't display it and your modified ExifWorks doesn't display it.  In that case it's not EXIF data, so the correct place to ask this question is at Photoshop support.  Be sure to explain the procedure that you used to get Photoshop to insert the data, because that probably determines how it is stored in the image.  If the information got inserted from some other application then you would need to ask at support for that other application.

    Thursday, March 22, 2018 1:53 AM
  • I did not want to set a value into the image data.

    I tried your code and it worked perfectly. I think it's a great way to extract image properties and I plan to use a modified version of your code extensively. I cannot thank you enough!


    RONATMOODYLAKE

    Thursday, March 22, 2018 2:03 AM
  • Have a look at Quick Image Comment - Source code is available. The rating of 3 in that image shows up in the "XMP" Tab, not the EXIF Tab
    Thursday, March 22, 2018 2:24 AM
  • I can see the Photoshop Elements tags that I created for a given image using Microsoft file explorer->properties->details. They are shown as values opposite the "Tags" property.  I currently use a package called ExifWorks.vb that I got through MSDN to extract image EXIF properties.  I want to modify this software to add the Photoshop Elements tags.  The EXIF tag in question is PhotoshopSettings = &H8649. Has anyone done this?

    RONATMOODYLAKE

    I found this, modified it (a lot):

    Imports System.Text
    Imports System.Windows.Media.Imaging
    
    Module Module1
        Sub readMetadata(ByVal filename As String)
            Dim img As BitmapSource = BitmapFrame.Create(New Uri(filename))
            Dim mpixel As Double = (img.PixelHeight * img.PixelWidth) / CDbl(1000000)
            Console.WriteLine("Pixelsize {0}x{1} ({2} megapixels)", img.PixelWidth, img.PixelHeight, mpixel)
            Console.WriteLine("DPI {0}x{1}", img.DpiX, img.DpiY)
            Dim meta As BitmapMetadata = CType(img.Metadata, BitmapMetadata)
            Console.WriteLine("Metadata:")
            Console.WriteLine("Title      : {0}", meta.Title)
            Console.WriteLine("Subject    : {0}", meta.Subject)
            Console.WriteLine("Comment    : {0}", meta.Comment)
            Console.WriteLine("Date taken : {0}", meta.DateTaken)
            Console.WriteLine("Camera     : {0} {1}", meta.CameraManufacturer, meta.CameraModel)
            Console.WriteLine("Copyright  : {0}", meta.Copyright)
            Console.WriteLine("Rating     : {0}", meta.Rating)
    
            Dim authors As New StringBuilder()
            If meta.Author IsNot Nothing Then
                For Each author As String In meta.Author
                    authors.Append(author & "; ")
                Next author
                Console.WriteLine("Author(s)  : {0}", authors.ToString())
            End If
            Dim keyWords As New StringBuilder()
            If meta.Keywords IsNot Nothing Then
                For Each keyword As String In meta.Keywords
                    keyWords.Append(keyword & "; ")
                Next keyword
                Console.WriteLine("Keywords   : {0}", keyWords.ToString())
            End If
            Console.WriteLine("")
        End Sub
    
        Sub Main(ByVal args() As String)
            readMetadata("D:\EXIF-Animal.jpg")
            Console.ReadLine()
        End Sub
    
    End Module
    
    References Required - PresentationCore, WindowsBase

    Output

    Thursday, March 22, 2018 3:26 AM
  • I tried your code and it worked perfectly. I think it's a great way to extract image properties and I plan to use a modified version of your code extensively. I cannot thank you enough!

    RONATMOODYLAKE

      If you where referring to the code from my post then please mark my post as the answer.  You seem to have marked Mr. Monkeyboy's post as the answer but,  his post was asking you a question,  not giving you an answer.  Marking the appropriate post(s) as answer(s) helps others find the answers easier.  Thanks.  8)

     

     @Mr. Monkeyboy,

     Nope,  unfortunately there is no SetDetailsOf method.  8)


    If you say it can`t be done then i`ll try it

    Thursday, March 22, 2018 7:51 PM