(view source code of lens.bat as plain text)
@ECHO OFF
IF "%~1"=="" GOTO Syntax
IF NOT "%~2"=="" GOTO Syntax
IF NOT EXIST "%~1" (
ECHO.
ECHO ←[1;31mERROR:←[0;1m image not found: "%~1"←[0m
GOTO Syntax
)
PHP.EXE -? >NUL 2>&1
IF ERRORLEVEL 1 (
ECHO.
ECHO ←[1;31mERROR:←[0;1m PHP.EXE not found←[0m
GOTO Syntax
)
SETLOCAL
SET File=%~1
SET File=%File:\=/%
PHP.EXE -r "print(@exif_read_data('%File%',null,true)['EXIF']['UndefinedTag:0xA434']);" | FINDSTR.EXE /R /C:"."
ENDLOCAL & EXIT /B %ErrorLevel%
:Syntax
ECHO.
ECHO Lens.bat, Version 1.00 for Windows 10 and later
ECHO Use PHP to read the lens type from an image's EXIF data
ECHO.
ECHO Usage: ←[1mLens.bat image←[0m
ECHO.
ECHO Where: ←[1mimage←[0m is the image file to be investigated
ECHO.
ECHO Notes: This batch file requires PHP.EXE, which can be downloaded from
ECHO ←[1;30mhttps://www.php.net/downloads.php←[0m
ECHO Successfully extracted lens data will be displayed on screen.
ECHO The batch file can return the following errorlevels:
ECHO 0: lens data successfully extracted
ECHO 1: no lens data could be found
ECHO -1: command line error, or image or PHP.EXE not found
ECHO.
ECHO Written by Rob van der Woude
ECHO https://www.robvanderwoude.com
EXIT /B -1
page last modified: 2024-04-16; loaded in 0.0041 seconds