Rob van der Woude's Scripting Pages

News Archives 2022 Q3


[ Back to the current news page... ]


URLEscape.exe is a new command line tool to URL-escape a URL specified on the command line, or from a text file or from redirected input.
It does not escape colons and forward slashes!
Be aware that if you want to "capture" the output in a FOR /F loop, escaped spaces (%20) may be interpreted as %2 (second command line argument) followed by a zero.


CompareImages.exe is a new command line tool to compare 2 images pixel by pixel, ignoring EXIF and IPTC metadata.
I wrote it to automate the process of restoring EXIF metadata in JPG files edited with Corel paintshop Pro (which corrupts part of the EXIF metadata).
After editing a photograph with Corel paintshop Pro and saving it as JPG file, I use ExifTool by Phil Harvey to copy the EXIF data from the raw image to the edited JPG file:
exiftool.exe -TagsFromFile myimage.cr2 myimage.jpg
ExifTool renames the original myimage.jpg to myimage.jpg_original and saves the modified image under the original myimage.jpg name.
So next, if myimage.jpg_original exists, I use CompareImages.exe to check if I can delete the original file (the one with the corrupted EXIF data):
CompareImages.exe myimage.jpg myimage.jpg_original
IF %Errorlevel% EQU 0 DEL myimage.jpg_original

WARNING: Don't delete files based on this tool's output unless you have a verified backup available!
Optionally, you can use CloneDate or CaptureDate to set the file time to the capture time.
Comparing images can be done interactively too, I used WinMerge up till now, but having to restore well over 10,000 photos I decided to automate it.


ClipboardAppend.exe and ClipboardPrepend.exe are 2 new command line tools to send text to the clipboard, appending or prepending it to text already in the clipboard.


• A bug in LoCase.exe was discovered: it would pass the input unmodified if the /S switch was used without the /L switch.
This has been fixed.


LoCase.exe has been updated: it can now optionally turn a specified part of a string or filename to lowercase, leaving the rest unchanged.


Trim.exe is a new command line tool to trim leading and trailing whitespace (including linefeeds) from text specified on the command line, or from a text file or from redirected input.
HTMLEscape.exe is a new command line tool to HTML-escape text specified on the command line, or from a text file or from redirected input.


• An additional test for improperly or unterminated curly braces has been added to CheckVarsPHP.exe.


CheckVarsPHP.exe has been updated: it now does check for nested functions or unterminated curly braces.


CheckVarsPHP.exe is a new quick-and-dirty program to check PHP code for unused variables and functions.
Though it was derived from CheckVarsVBS.exe, there are some differences:


• Bob Berry sent me sample batch code to demonstrate a flaw in batch programming:
IF condition (...)
ELSE (...)

will return incorrect results, especially when nested, but it will not generate a warning or error message.
The proper format is
IF condition (...) ELSE (...)
where the parts between parentheses may or may not be spread over multiple lines:
IF condition (
) ELSE (

As this error is easy to detect and correct, I added a test for this error in my BatCodeCheck program.

Thanks Bob



Archived News pages
Archived news from 2022
Archived news from 2021
Archived news from 2020
Archived news from 2019
Archived news from 2018
Archived news from 2017
Archived news from 2016
Archived news from 2015
Archived news from 2014
Archived news from 2013
Archived news from 2012
Archived news from 2011
Archived news from 2010
Archived news from 2009
Archived news from 2008
Archived news from 2007



page last modified: 2022-10-23