Script that scans a folder and physically timestamps the photo. Replace orginal File
- or -
Post a project like this2897
£75(approx. $93)
- Posted:
- Proposals: 1
- Remote
- #1121604
- Completed
Description
Experience Level: Intermediate
General information for the business: We are an electrical Utility Company
Description of requirements/functionality: We have a program our field guys use to send photo's of the work been done. which is stored on a main server and can be viewed through a website portal. On the server side we have a main folder where subfolders are stored for all the jobs and the photos are stored in each different subfolder.
Essentially we require a script that Physically time stamps these photos using the date taken metadata and then only time stamps new photos coming in. The timestamped photo needs to replace the original photo and cannot be stored in a output folder as then our application would not be able to separate these by jobs.
Time Stamping Spec
- TimeStamp New Photo’s of all types
- Save to original Folder as it is a job folder
- Must Not Create or copy file or if it does it needs to overwrite the original
- Cannot Repeat already stamped file
- No Specific naming scheme required as application uses folders not names
OS requirements: Windows
Extra notes: I have tried a script before which looks like it would have done most things however it outputs to a folder it creates called stamped which we cannot use as the photo needs to stay in the original folder i have copied the script below this script works in conjunction with ImageMagick
@echo off & cls
rem enable variables referencing themselves inside loops
SetLocal EnableDelayedExpansion
rem optional settings
set fontcolor=#FFD800
set fontoutlinecolor=#000000
set fontstyle="Arial-Bold"
rem create a new folder where the stamped images will be placed
mkdir stamped
rem loop through all jpg png jpeg and gif files in the current folder
for /f "delims=" %%a in ('dir /b /A:-D /T:C "%cd%\*.jpg" "%cd%\*.png" "%cd%\*.jpeg" "%cd%\*.gif"') do (
rem retrieve image date and time
SetLocal EnableDelayedExpansion
for /f "tokens=1-2" %%i in ('identify.exe -ping -format "%%w %%h" "%cd%\%%a"') do set W=%%i& set H=%%j
rem retrieve image timestamp to perform size and distance calculations on
SetLocal EnableDelayedExpansion
for /f "tokens=1-2 delims=" %%k in ('identify -format "%%[EXIF:DateTimeOriginal]" "%cd%\%%a"') do set timestamp=%%k
rem set timestamp to no timestamp if there is no timestamp
if "!timestamp!" == "" (
set timestamp=No timestamp
)
rem print some information about the process
echo %%a is !W! x !H! stamp !timestamp! ...
rem set timestamp size to a fourth of the screen width
set /A timestampsize = !W! / 3
rem set timestamp offset distance from side of the screen
set /A timestampoffset = !W! / 20
rem set timestamp outline relative size
set /A outlinewidth = !W! / 600
rem echo !timestampsize! !timestampoffset!
rem create a custom image with the timestamp with transparent background and combine it with the image
convert.exe ^
-verbose ^
-background none^
-stroke !fontoutlinecolor! ^
-strokewidth !outlinewidth! ^
-font !fontstyle! ^
-fill !fontcolor! ^
-size !timestampsize!x ^
-gravity center label:"!timestamp!" "%cd%\%%a" +swap ^
-gravity southeast ^
-geometry +!timestampoffset!+!timestampoffset! ^
-stroke !fontoutlinecolor! ^
-strokewidth !outlinewidth! ^
-composite "%cd%\stamped\%%a"
endlocal
endlocal
echo.
)
endlocal
echo Complete!
pause
Description of requirements/functionality: We have a program our field guys use to send photo's of the work been done. which is stored on a main server and can be viewed through a website portal. On the server side we have a main folder where subfolders are stored for all the jobs and the photos are stored in each different subfolder.
Essentially we require a script that Physically time stamps these photos using the date taken metadata and then only time stamps new photos coming in. The timestamped photo needs to replace the original photo and cannot be stored in a output folder as then our application would not be able to separate these by jobs.
Time Stamping Spec
- TimeStamp New Photo’s of all types
- Save to original Folder as it is a job folder
- Must Not Create or copy file or if it does it needs to overwrite the original
- Cannot Repeat already stamped file
- No Specific naming scheme required as application uses folders not names
OS requirements: Windows
Extra notes: I have tried a script before which looks like it would have done most things however it outputs to a folder it creates called stamped which we cannot use as the photo needs to stay in the original folder i have copied the script below this script works in conjunction with ImageMagick
@echo off & cls
rem enable variables referencing themselves inside loops
SetLocal EnableDelayedExpansion
rem optional settings
set fontcolor=#FFD800
set fontoutlinecolor=#000000
set fontstyle="Arial-Bold"
rem create a new folder where the stamped images will be placed
mkdir stamped
rem loop through all jpg png jpeg and gif files in the current folder
for /f "delims=" %%a in ('dir /b /A:-D /T:C "%cd%\*.jpg" "%cd%\*.png" "%cd%\*.jpeg" "%cd%\*.gif"') do (
rem retrieve image date and time
SetLocal EnableDelayedExpansion
for /f "tokens=1-2" %%i in ('identify.exe -ping -format "%%w %%h" "%cd%\%%a"') do set W=%%i& set H=%%j
rem retrieve image timestamp to perform size and distance calculations on
SetLocal EnableDelayedExpansion
for /f "tokens=1-2 delims=" %%k in ('identify -format "%%[EXIF:DateTimeOriginal]" "%cd%\%%a"') do set timestamp=%%k
rem set timestamp to no timestamp if there is no timestamp
if "!timestamp!" == "" (
set timestamp=No timestamp
)
rem print some information about the process
echo %%a is !W! x !H! stamp !timestamp! ...
rem set timestamp size to a fourth of the screen width
set /A timestampsize = !W! / 3
rem set timestamp offset distance from side of the screen
set /A timestampoffset = !W! / 20
rem set timestamp outline relative size
set /A outlinewidth = !W! / 600
rem echo !timestampsize! !timestampoffset!
rem create a custom image with the timestamp with transparent background and combine it with the image
convert.exe ^
-verbose ^
-background none^
-stroke !fontoutlinecolor! ^
-strokewidth !outlinewidth! ^
-font !fontstyle! ^
-fill !fontcolor! ^
-size !timestampsize!x ^
-gravity center label:"!timestamp!" "%cd%\%%a" +swap ^
-gravity southeast ^
-geometry +!timestampoffset!+!timestampoffset! ^
-stroke !fontoutlinecolor! ^
-strokewidth !outlinewidth! ^
-composite "%cd%\stamped\%%a"
endlocal
endlocal
echo.
)
endlocal
echo Complete!
pause
Paul M.
100% (4)Projects Completed
4
Freelancers worked with
4
Projects awarded
57%
Last project
14 Aug 2018
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies