Sort by date picture taken

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • brandoncall@gmail.com

    #1

    Sort by date picture taken

    Hi,

    I am displaying a bunch of pictures on my website and I would like to
    sort them by a Date Picture Taken key. I have looked into exif data
    and I wrote a little code that just prints all the keys and their
    contents.
    Code:
    $file = "MyPicture.jpg" ;
    $exif = read_exif_data ("$file");
    while(list($k,$ v)=each($exif))
    {
    echo "$k: $v<br>\n";
    }

    For date picture taken, All I get is:

    FileName: MyPicture.jpg
    FileDateTime: 1180959961
    ....
    ExifVersion: 1220
    DateTimeOrigina l:
    DateTimeDigitiz ed:
    CompressedBitsP erPixel: 892484151/3289658
    ....

    nothing as you can see. Here is the info from phpinfo about my exif
    setup:
    exif
    EXIF Support enabled
    EXIF Version 1.4 $Id: exif.c,v 1.173.2.5 2006/04/10 18:23:24 helly
    Exp $
    Supported EXIF Version 0220
    Supported filetypes JPEG,TIFF

    When I download the jpg, I can view/sort by the date picture taken
    using Windows Explorer.

    Does anyone know why I am not seeing the DateTimeOrigina l information?

    If anyone knows a better way to sort by Date Picture Taken On, I'd
    love to hear it. Windows can do it so it must be in there somewhere.

  • petersprc

    #2
    Re: Sort by date picture taken

    Not sure, explorer may be falling back to a different value in the
    absence of DateTimeOrigina l. Btw, this tool can set the
    DateTimeOrigina l field: http://www.exifpro.com/Help/ToolDateTime.htm

    On Jun 16, 6:59 am, "brandonc...@gm ail.com" <brandonc...@gm ail.com>
    wrote:
    Hi,
    >
    I am displaying a bunch of pictures on my website and I would like to
    sort them by a Date Picture Taken key. I have looked into exif data
    and I wrote a little code that just prints all the keys and their
    contents.
    Code:
    $file = "MyPicture.jpg" ;
    $exif = read_exif_data ("$file");
    while(list($k,$ v)=each($exif))
    {
    echo "$k: $v<br>\n";
    >
    }
    >
    For date picture taken, All I get is:
    >
    FileName: MyPicture.jpg
    FileDateTime: 1180959961
    ...
    ExifVersion: 1220
    DateTimeOrigina l:
    DateTimeDigitiz ed:
    CompressedBitsP erPixel: 892484151/3289658
    ...
    >
    nothing as you can see. Here is the info from phpinfo about my exif
    setup:
    exif
    EXIF Support enabled
    EXIF Version 1.4 $Id: exif.c,v 1.173.2.5 2006/04/10 18:23:24 helly
    Exp $
    Supported EXIF Version 0220
    Supported filetypes JPEG,TIFF
    >
    When I download the jpg, I can view/sort by the date picture taken
    using Windows Explorer.
    >
    Does anyone know why I am not seeing the DateTimeOrigina l information?
    >
    If anyone knows a better way to sort by Date Picture Taken On, I'd
    love to hear it. Windows can do it so it must be in there somewhere.

    Comment

    Working...