Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9119307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:21:53+00:00 2026-06-17T05:21:53+00:00

I’m a little bit surprised and puzzled. I try to read the property items

  • 0

I’m a little bit surprised and puzzled. I try to read the property items from an image. Particularly, I’m interested in the “Date Taken”. I have written a procedure that does exactly that. More or less. With some files it works perfectly, but…

I have some files that have a ‘Date Taken’ in the properties (when viewed by Windows Explorer, Windows 7 x64). They differ from the date created, modified and accessed. So I do have a 4th date.
However, if I loop through the property items, it does not show up (on any ID).
When I look for it on the PropertyItem.Id (0x9003 or 36867), i get that the property item does not exist.

My Code to loop through the property items:

        for (int i = 0; i < fileNames.Length; i++)
        {
            FileStream fs = new FileStream(fileNames[i], FileMode.Open, FileAccess.Read);
            Image pic = Image.FromStream(fs, false, false);



            int t = 0;
            foreach (PropertyItem pii in pic.PropertyItems)
            {
                MessageBox.Show(encoding.GetString(pii.Value, 0, pii.Len - 1) + " - ID: " + t.ToString());
                t++;
            }
        }

The code to read only the “Date Taken” property (I stole from here: http://snipplr.com/view/25074/)

    public static DateTime DateTaken(Image getImage)
    {
        int DateTakenValue = 0x9003; //36867;

        if (!getImage.PropertyIdList.Contains(DateTakenValue))
            return DateTime.Parse("01-01-2000");

        string dateTakenTag = System.Text.Encoding.ASCII.GetString(getImage.GetPropertyItem(DateTakenValue).Value);
        string[] parts = dateTakenTag.Split(':', ' ');
        int year = int.Parse(parts[0]);
        int month = int.Parse(parts[1]);
        int day = int.Parse(parts[2]);
        int hour = int.Parse(parts[3]);
        int minute = int.Parse(parts[4]);
        int second = int.Parse(parts[5]);

        return new DateTime(year, month, day, hour, minute, second);
    }

However, when I change the date taken in the ‘File properties window’ of Windows Explorer, It starts to show up in my program.

So my question is: Where does this “Date Taken” comes from? How can I access it? Could it be that there is another source of information besides the EFIX Data?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:21:54+00:00Added an answer on June 17, 2026 at 5:21 am

    you can try something like this if you want to start with some basic coding

    // Load an image however you like.
    System.Drawing.Image image = new Bitmap(“my-picture.jpg”);

    Referenced from AbbydonKrafts
    
    // Get the Date Created property 
    //System.Drawing.Imaging.PropertyItem propertyItem = image.GetPropertyItem( 0x132 );
    System.Drawing.Imaging.PropertyItem propertyItem 
             = image.PropertyItems.FirstOrDefault(i => i.Id == 0x132 ); 
    if( propItem != null ) 
    { 
      // Extract the property value as a String. 
      System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); 
      string text = encoding.GetString(propertyItem.Value, 0, propertyItem.Len - 1 ); 
    
      // Parse the date and time. 
      System.Globalization.CultureInfo provider = CultureInfo.InvariantCulture; 
      DateTime dateCreated = DateTime.ParseExact( text, "yyyy:MM:d H:m:s", provider ); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am using JSon response to parse title,date content and thumbnail images and place
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm interested in microtypography issues on the web. I want a tool to fix:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a view passing on information from a database: def serve_article(request, id): served_article

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.