Simple command-line utility which appends dimensions to image and video file names. Available for Windows, Mac and Linux.
Registration is required in order to download imgdim. Follow these easy steps:
$PATH
- https://en.wikipedia.org/wiki/PATH_(variable).imgdim link PASSWORD_TO_YOUR_ACCOUNT
Note that in order to use imgdim for more than 14-days (trial period) you need to purchase full license.
list
command (shorthand ls
) displays dimensions for supported files inside current directory by default:
[email protected]:~/images# imgdim list [2018-05-02 20:26:02] INFO [sample.bmp] width=640 height=480 path=/root/images/sample.bmp new_path=/root/images/sample_640x480.bmp command=list [2018-05-02 20:26:02] INFO [sample.gif] width=640 height=480 path=/root/images/sample.gif new_path=/root/images/sample_640x480.gif command=list
Files without proper extensions are also detected:
[email protected]:~/imageswoextension# ls sample1 sample2 [email protected]:~/imageswoextension# imgdim list [2018-05-02 20:26:02] INFO [sample1] width=640 height=480 path=/root/imageswoextension/sample1 new_path=/root/imageswoextension/sample1_640x480 command=list [2018-05-02 20:26:02] INFO [sample2] width=640 height=480 path=/root/imageswoextension/sample2 new_path=/root/imageswoextension/sample2_640x480 command=list
Sub-directories are not processed by default but you can pass --recursive
option (shorthand -r
) to change that:
[email protected]:~/images# imgdim list --recursive [2018-05-02 20:26:02] INFO [sample.bmp] width=640 height=480 path=/root/images/sample.bmp new_path=/root/images/sample_640x480.bmp command=list [2018-05-02 20:26:02] INFO [sample.gif] width=640 height=480 path=/root/images/sample.gif new_path=/root/images/sample_640x480.gif command=list [2018-05-02 20:26:02] INFO [sample.psd] width=640 height=480 path=/root/images/website/sample.psd new_path=/root/images/website/sample_640x480.psd command=list
You can also pass list of directories or files to process as arguments:
[email protected]:~/images# imgdim list sample.bmp /some/other/dir [2018-05-02 20:26:02] INFO [sample.bmp] width=640 height=480 path=/root/images/sample.bmp new_path=/root/images/sample_640x480.bmp command=list ...
You may find --json
option (shorthand -j
) convenient if you would like to machine-process program output:
[email protected]:~/images# imgdim list --json sample.bmp {"command":"list","height":480,"level":"info","msg":"[sample.bmp]","new_path":"/root/images/sample_640x480.bmp","path":"/root/images/sample.bmp","time":"2018-05-03T16:39:00Z","width":640}
--json
and --recursive
options can be also used with move
and copy
commands.
move
command (shorthand mv
) will be probably most frequently used one. It actually renames the files by appending dimensions:
[email protected]:~/images# ls sample.bmp sample.gif [email protected]:~/images# imgdim move [2018-05-02 20:26:02] INFO [sample.bmp] width=640 height=480 path=/root/images/sample.bmp new_path=/root/images/sample_640x480.bmp command=move [2018-05-02 20:26:02] INFO [sample.gif] width=640 height=480 path=/root/images/sample.gif new_path=/root/images/sample_640x480.gif command=move [email protected]:~/images# ls sample_640x480.bmp sample_640x480.gif
You can customize how new filename will look like with --template
option (shorthand -t
):
[email protected]:~/images# imgdim move --template "{name}-{width}-{height}{extension}" [2018-05-02 20:26:02] INFO [sample.bmp] width=640 height=480 path=/root/images/sample.bmp new_path=/root/images/sample-640-480.bmp command=move [2018-05-02 20:26:02] INFO [sample.gif] width=640 height=480 path=/root/images/sample.gif new_path=/root/images/sample-640-480.gif command=move [email protected]:~/images# ls sample-640-480.bmp sample-640-480.gif
copy
command (shorthand cp
) works similar to move command but it creates copies with dimensions appended so source files are not deleted:
[email protected]:~/images# ls sample.bmp sample.gif [email protected]:~/images# imgdim copy [2018-05-02 20:26:02] INFO [sample.bmp] width=640 height=480 path=/root/images/sample.bmp new_path=/root/images/sample_640x480.bmp command=copy [2018-05-02 20:26:02] INFO [sample.gif] width=640 height=480 path=/root/images/sample.gif new_path=/root/images/sample_640x480.gif command=copy [email protected]:~/images# ls sample.bmp sample_640x480.bmp sample.gif sample_640x480.gif
link
command (shorthand ln
) links imgdim installation to your account:
[email protected]:~/images# imgdim link PASSWORD_TO_YOUR_ACCOUNT [2018-05-02 20:26:02] INFO [installation linked successfully]
If your password contains spaces, surround it with double quotes.
If you are using Windows operating system you may add imgdim shortcuts to right-click context menu. Just run imgdim.exe install
(shortcut in
) and interactive installer will let you pick which shortcuts to add. To uninstall installed shortcuts run imgdim.exe uninstall
(shortcut un
).
Format | Extension | MIME |
---|---|---|
Joint Photographic Experts Group | jpg | image/jpeg |
Portable Network Graphics | png | image/png |
Graphics Interchange Format | gif | image/gif |
Bitmap Image File | bmp | image/bmp |
Tagged Image File Format | tif | image/tiff |
WebP | webp | image/webp |
Photoshop Document | psd | image/vnd.adobe.photoshop |
Range of supported video formats depends on the type of third-party executable installed.
imgdim alone cannot detect video files dimensions (yet). It requires one of the following executables installed and available in $PATH
:
Executable | Website |
---|---|
ffprobe | https://www.ffmpeg.org/download.html |
mediainfo | https://mediaarea.net/pl/MediaInfo/Download |
exiftool | https://www.sno.phy.queensu.ca/~phil/exiftool/ |
All above tools are free. Please refer to linked websites for installation instructions for your operating system.