Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to get the metadata of a file (an image) in Qt
Forum Updated to NodeBB v4.3 + New Features

How to get the metadata of a file (an image) in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 642 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • lincolnL Offline
    lincolnL Offline
    lincoln
    wrote on last edited by
    #1

    Hi guys, my question is simple, I'm trying to read the metadata of a file, especially an image, what I want is to access all its metadata, particularly its date and time of capture, I get a different date than the one The image was captured with a cell phone camera.

    I have tried the following:

    QFileInfo finfo("D:/images/20190613_091503.jpg");
      qInfo() << finfo.birthTime().toString("dd/MM/yyyy h:m:ss AP");
      qInfo() << finfo.lastModified().toString("dd/MM/yyyy h:m:ss AP");
      qInfo() << finfo.lastRead().toString("dd/MM/yyyy h:m:ss AP");
    

    Get some data from the QFileInfo class, such as date and time, but they show me different dates, from the date of creation or capture of the image.

    335a39f3-87a3-4548-85b6-ed23a6f88955-image.png

    4dee569b-19a0-48d8-ae1f-12ea2e236093-image.png

    As you can see, it shows me several dates and none of them coincide with the original capture date of the image. So how could I get the correct date and time of image capture, thanks.

    Solitary wolf

    C 1 Reply Last reply
    0
    • lincolnL lincoln

      Hi guys, my question is simple, I'm trying to read the metadata of a file, especially an image, what I want is to access all its metadata, particularly its date and time of capture, I get a different date than the one The image was captured with a cell phone camera.

      I have tried the following:

      QFileInfo finfo("D:/images/20190613_091503.jpg");
        qInfo() << finfo.birthTime().toString("dd/MM/yyyy h:m:ss AP");
        qInfo() << finfo.lastModified().toString("dd/MM/yyyy h:m:ss AP");
        qInfo() << finfo.lastRead().toString("dd/MM/yyyy h:m:ss AP");
      

      Get some data from the QFileInfo class, such as date and time, but they show me different dates, from the date of creation or capture of the image.

      335a39f3-87a3-4548-85b6-ed23a6f88955-image.png

      4dee569b-19a0-48d8-ae1f-12ea2e236093-image.png

      As you can see, it shows me several dates and none of them coincide with the original capture date of the image. So how could I get the correct date and time of image capture, thanks.

      C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @lincoln Image metadata, such as location, exposure, timestamps etc. can be stored inside the image file as EXIF tags. You can use something like libexif to handle these.

      lincolnL 1 Reply Last reply
      0
      • C ChrisW67

        @lincoln Image metadata, such as location, exposure, timestamps etc. can be stored inside the image file as EXIF tags. You can use something like libexif to handle these.

        lincolnL Offline
        lincolnL Offline
        lincoln
        wrote on last edited by
        #3

        @ChrisW67 Ahh, ok good info thanks, I'll take a look at that library; thank you.

        Solitary wolf

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved