CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2003
    Location
    Timisoara, Romania
    Posts
    306

    [RESOLVED] JPEG's create time detection

    I need to find the creation time of a JPEG file (additionally other image file formats, too).
    For instance, IrfanView application offers this information in Images -> Information menu.

    http://www.codeguru.com/forum/attach...1&d=1285526629

    I'm looking for a simply detection way (without extern commercial library or a very complex library).
    I was thinking to start from JPEG file header, but as I can see from here, the information that I'm looking for it doesn't appear in header.
    Attached Images Attached Images

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: JPEG's create time detection

    Your image shows the file date/time. This has nothing to do with the fact that it is a image, but simply with the fact that it is a file.

  3. #3
    Join Date
    Jan 2003
    Location
    Timisoara, Romania
    Posts
    306

    Re: JPEG's create time detection

    My image is window Information screenshot from IrfanView application.
    I think that the information that I'm looking for is contained by Exchangeable image file format (Exif).
    Somebody recommended me Exiv2 C++ library.
    Any right recommandations are appreciated.

  4. #4
    Join Date
    Feb 2002
    Posts
    4,640

    Re: JPEG's create time detection

    Quote Originally Posted by Maximus_X View Post
    My image is window Information screenshot from IrfanView application.
    I think that the information that I'm looking for is contained by Exchangeable image file format (Exif).
    Somebody recommended me Exiv2 C++ library.
    Any right recommandations are appreciated.
    Right, and Skizmo was referring to the fact that this data can easily be read off of the disk (no need to obtain it from the file internals). In other words, this is a property of the file not a property of the file type (and what it may or may not contain).

    Viggy

  5. #5
    Join Date
    Jan 2003
    Location
    Timisoara, Romania
    Posts
    306

    Re: JPEG's create time detection

    Maybe I was not so clear. I am looking for the date when a picture was created in the camera, not as a any other file property on a disk.
    I need that internal metadata instead of WIN32_FIND_DATA and stuff.
    That's why I think that I need simply library that works with Exchangeable image file format (Exif).

  6. #6
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: JPEG's create time detection

    If you want file creation time, then follow what other people above said.
    If you want date of picture taken, then this is stored in EXIF and your best bet is to use a library to parse EXIF for you.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  7. #7
    Join Date
    Jan 2003
    Location
    Timisoara, Romania
    Posts
    306

    Re: JPEG's create time detection

    I thought that it was clear from the beginning that I was taking about the data that a camera writes in a file not about normal files properties.
    The attachment was special introduced in order to avoid any confusion.
    Meantime a found a simple and useful class CExif. Thank you.

  8. #8
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: JPEG's create time detection

    Quote Originally Posted by Maximus_X View Post
    I thought that it was clear from the beginning that I was taking about the data that a camera writes in a file not about normal files properties.
    The attachment was special introduced in order to avoid any confusion.
    Meantime a found a simple and useful class CExif. Thank you.
    Sorry, but that screenshot just confused more than it solved. That screenshot is showing the file-date on the filesystem, not the date when the picture was taken. If you want the date when the picture was taken you should have clicked the "Exif..." button on your screenshot and attached that screenshot.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  9. #9
    Join Date
    Jan 2003
    Location
    Timisoara, Romania
    Posts
    306

    Re: [RESOLVED] JPEG's create time detection

    Sorry guys for this confusion. In the moment when I posted this attachment I didn't know about Exif.
    I was wrong because that date was the date and time of the event when the picture was created and I took it right.
    I copied the pictures from SSD only after two days. Maybe my Irfanview app or camera has a bug.
    Indeed, exinf button shows the right data.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured