How to retrieve date/time information from JPG file?

Discussion in 'Java' started by Wenwei Weng, Jun 16, 2004.

  1. Wenwei Weng

    Wenwei Weng Guest

    hello,

    I bought a Canon Powershot A80 digital camera. Sadly, I found out that date
    is not shown on the image. Only if I buy Canaon photo printer, the date can
    be printed on the photo. I believe it is Canon's dirty marketing strategy.

    So I decide to write a program to put the date on the image. I have almost
    completed: it take the image file name, and the date to be put on. It works
    fine. But my friend told me that the date actually can be retrieved from JPG
    image file itself, it is part of image property.

    Wondering anyone has done this. Any help will be appreciated.

    Thanks in advance.
    Wenwei
    Wenwei Weng, Jun 16, 2004
    #1
    1. Advertising

  2. Wenwei Weng

    Roedy Green Guest

    On Wed, 16 Jun 2004 11:39:12 -0700, "Wenwei Weng" <>
    wrote or quoted :

    >
    >So I decide to write a program to put the date on the image. I have almost
    >completed: it take the image file name, and the date to be put on. It works
    >fine. But my friend told me that the date actually can be retrieved from JPG
    >image file itself, it is part of image property.


    t may be potentially in there, but it looks like the Canon camera has
    no clock, so don't hold your breath. A clock need to be resynched. If
    it is there, it should be obvious.



    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jun 16, 2004
    #2
    1. Advertising

  3. Wenwei Weng

    Wenwei Weng Guest

    The Camera manual explicitly says that "even you turn on date/time, it
    doesn't mean date/time will be shown on the image. But if you want to print
    the image, date/time can be printed. See Software Guide..."

    "Roedy Green" <> wrote in message
    news:...
    > On Wed, 16 Jun 2004 11:39:12 -0700, "Wenwei Weng" <>
    > wrote or quoted :
    >
    > >
    > >So I decide to write a program to put the date on the image. I have

    almost
    > >completed: it take the image file name, and the date to be put on. It

    works
    > >fine. But my friend told me that the date actually can be retrieved from

    JPG
    > >image file itself, it is part of image property.

    >
    > t may be potentially in there, but it looks like the Canon camera has
    > no clock, so don't hold your breath. A clock need to be resynched. If
    > it is there, it should be obvious.
    >
    >
    >
    > --
    > Canadian Mind Products, Roedy Green.
    > Coaching, problem solving, economical contract programming.
    > See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Wenwei Weng, Jun 16, 2004
    #3
  4. Wenwei Weng

    VisionSet Guest

    "Wenwei Weng" <> wrote in message
    news:1087410980.434626@sj-nntpcache-5...
    > hello,
    >
    > I bought a Canon Powershot A80 digital camera. Sadly, I found out that

    date
    > is not shown on the image. Only if I buy Canaon photo printer, the date

    can
    > be printed on the photo. I believe it is Canon's dirty marketing strategy.
    >
    > So I decide to write a program to put the date on the image. I have almost
    > completed: it take the image file name, and the date to be put on. It

    works
    > fine. But my friend told me that the date actually can be retrieved from

    JPG
    > image file itself, it is part of image property.
    >
    > Wondering anyone has done this. Any help will be appreciated.
    >


    I think this will do that if it is in there, and I think it usually is.
    My own Canon Ixus400 images provide a host of fields to photoshop including
    date.

    javax.imageio.metadata

    --
    Mike W
    VisionSet, Jun 16, 2004
    #4
  5. Wenwei Weng

    Roedy Green Guest

    On Wed, 16 Jun 2004 12:04:50 -0700, "Wenwei Weng" <>
    wrote or quoted :

    >The Camera manual explicitly says that "even you turn on date/time, it
    >doesn't mean date/time will be shown on the image. But if you want to print
    >the image, date/time can be printed. See Software Guide..."


    IT could mean the printer adds the print date, or it could mean the
    date is encoded in the image, just not normally viewable. If the
    second, you are in luck.

    Try opening the image in various paint program to see if any know the
    date.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jun 16, 2004
    #5
  6. Wenwei Weng

    ak Guest

    ak, Jun 16, 2004
    #6
  7. Wenwei Weng wrote:
    > So I decide to write a program to put the date on the image. I have almost
    > completed: it take the image file name, and the date to be put on. It works
    > fine. But my friend told me that the date actually can be retrieved from JPG
    > image file itself, it is part of image property.


    Here's a program that displays the various EXIF metadata fields,
    complete with Java source code: http://www.instituteofthefuture.org/exifomatic/
    Michael Borgwardt, Jun 17, 2004
    #7
  8. Wenwei Weng

    Nigel Wade Guest

    On Wed, 16 Jun 2004 11:39:12 -0700, Wenwei Weng wrote:

    > hello,
    >
    > I bought a Canon Powershot A80 digital camera. Sadly, I found out that
    > date is not shown on the image. Only if I buy Canaon photo printer, the
    > date can be printed on the photo. I believe it is Canon's dirty
    > marketing strategy.


    There's no conspiracy. Many picture editing packages access this
    information. Some will allow you to add it to the picture, or make it into
    a watermark.


    > So I decide to write a program to put the date on the image. I have
    > almost completed: it take the image file name, and the date to be put
    > on. It works fine. But my friend told me that the date actually can be
    > retrieved from JPG image file itself, it is part of image property.


    He is right. It's part of the Exif meta-information stored with the image.
    It typically includes exposure settings (aperture, focal length, shutter
    speed) as well as date/time, and other things I can't remember offhand.


    > Wondering anyone has done this. Any help will be appreciated.


    JAlbum has already done it all. If you want to create very nice albums,
    Web sites, thumbnails etc., JAlbum is the best place I know to start. URL
    is http://www.jalbum.net (and it's free). No source though, but it does
    have a documented API (to bring it on topic - not that I've tried it).



    --
    Nigel Wade, System Administrator, Space Plasma Physics Group,
    University of Leicester, Leicester, LE1 7RH, UK
    E-mail :
    Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
    Nigel Wade, Jun 17, 2004
    #8
  9. Wenwei Weng

    Marcel Guest

    What you're looking for (if you're still looking for it) can be found
    at

    http://www.drewnoakes.com/code/exif/

    Not only can the time be read, but also tons of other stuff (did the
    flash fire? What was the shutter speed? Were any comments added? What
    kind (make and model) of camera took the picutre? etcetcetc).

    This is also the library used by the PicL tool
    (http://picl.sourceforge.net), used to move your files around based on
    metadata. A new release is planned soon, by the way...

    Good luck!
    Marcel


    "Wenwei Weng" <> wrote in message news:<1087410980.434626@sj-nntpcache-5>...
    > hello,
    >
    > I bought a Canon Powershot A80 digital camera. Sadly, I found out that date
    > is not shown on the image. Only if I buy Canaon photo printer, the date can
    > be printed on the photo. I believe it is Canon's dirty marketing strategy.
    >
    > So I decide to write a program to put the date on the image. I have almost
    > completed: it take the image file name, and the date to be put on. It works
    > fine. But my friend told me that the date actually can be retrieved from JPG
    > image file itself, it is part of image property.
    >
    > Wondering anyone has done this. Any help will be appreciated.
    >
    > Thanks in advance.
    > Wenwei
    Marcel, Jun 28, 2004
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roland
    Replies:
    0
    Views:
    1,055
    Roland
    May 12, 2004
  2. Matthias
    Replies:
    5
    Views:
    425
    Whitecrest
    Jun 1, 2004
  3. Yannick

    ASP changes Big JPG -> Small JPG

    Yannick, Feb 2, 2004, in forum: ASP General
    Replies:
    6
    Views:
    151
    Tim Williams
    Feb 3, 2004
  4. Vilmar Brazão de Oliveira
    Replies:
    14
    Views:
    345
    Aaron Bertrand [MVP]
    Mar 5, 2004
  5. Replies:
    3
    Views:
    259
    Andy Dingley
    Sep 27, 2006
Loading...

Share This Page