/    Sign up×
Community /Pin to ProfileBookmark

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

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@Steve_R_JonesmoderatorDec 28.2013 — Hate to ask - but have you read the manual for the camera?
Copy linkTweet thisAlerts:
@Kjartan_HaugenauthorDec 28.2013 — Yes, and the d-link webcam I have does not offer timestamp directly on photos.
Copy linkTweet thisAlerts:
@Steve_R_JonesmoderatorDec 28.2013 — 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/Consumer_Products/DCS/DCS%20932L/Manuals/DCS_932L_Manual_v_1_EN_UK.pdf[/QUOTE]


Maybe you can extract this information..
Copy linkTweet thisAlerts:
@Kjartan_HaugenauthorDec 28.2013 — Yes, I think that would be possible in some way.. but im not sure how to "timestamp" a photo with that data.
Copy linkTweet thisAlerts:
@rootDec 28.2013 — 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-library-adding-text-writing.php
Copy linkTweet thisAlerts:
@rootDec 28.2013 — DCS9302010072116425101.jpg can be split

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

[code=php]$full_filename = "DCS9302010072116425101.jpg";

$stamp_str = substr ($full_filename , 6, 22 );

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

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

$picture = substr ($stamp_str , 14, 2 );[/code]


Will extract to variables that you can then format like so...

[code=php]$timestamp = sprintf("%s/%s/%s - %s:%s:%s - [%s]", $day,$month,$year,$hour,$minutes,$seconds,$picture);[/code]
×

Success!

Help @Kjartan_Haugen spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...