www.webdeveloper.com
Results 1 to 7 of 7

Thread: Timestamp my webcam photos

  1. #1
    Join Date
    Aug 2012
    Posts
    8

    Timestamp my webcam photos

    Hi,
    I have a DSC 933L camera that uploads jpeg-files every 30minutes via ftp onto my website.
    How can I add timestamp (time+date) onto the photos?

    Thanks

  2. #2
    Join Date
    Nov 2011
    Location
    Dallas, TX
    Posts
    371
    Hate to ask - but have you read the manual for the camera?
    "Life is unpredictable, eat dessert first."

  3. #3
    Join Date
    Aug 2012
    Posts
    8
    Yes, and the d-link webcam I have does not offer timestamp directly on photos.

  4. #4
    Join Date
    Nov 2011
    Location
    Dallas, TX
    Posts
    371
    The manual does mention:

    This will be the name that precedes the time, for example DCS9302010072116425101.jpg. This means that the camera took a
    snapshot in the year 2010, July 21 at 16th hour (4 o’clock), 42 minutes and 51 seconds and it is picture number one.
    http://www.dlink.com/-/media/Consume..._v_1_EN_UK.pdf
    Maybe you can extract this information..

  5. #5
    Join Date
    Aug 2012
    Posts
    8
    Yes, I think that would be possible in some way.. but im not sure how to "timestamp" a photo with that data.

  6. #6
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,512
    Does it need time stamping or would a time reference on the picture be sufficient?

    If you need to do something with the image then the PHP image libray of functions provided by the GD library might be a good starting point.

    This may help you :

    http://www.phpforkids.com/php/php-gd...xt-writing.php
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  7. #7
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,512
    DCS9302010072116425101.jpg can be split

    If the file name length is constant, then you could use the following.

    PHP Code:
    $full_filename "DCS9302010072116425101.jpg";

    $stamp_str substr ($full_filename 622 );

    $year substr ($stamp_str 0);
    $month substr ($stamp_str 4);
    $day substr ($stamp_str 6);

    $hour substr ($stamp_str 8);
    $minutes substr ($stamp_str 10);
    $seconds substr ($stamp_str 12);

    $picture substr ($stamp_str 14); 
    Will extract to variables that you can then format like so...

    PHP Code:
    $timestamp sprintf("%s/%s/%s - %s:%s:%s - [%s]"$day,$month,$year,$hour,$minutes,$seconds,$picture); 
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles