Image File
Image File
Image File is an input node which will scan a file and load the Image Information (width/height etc) for processing in the flow.
Variables
Variable | Description | Type | Example |
---|---|---|---|
img.Width | Image width | number | 1920 |
img.Height | Image height | number | 1080 |
img.Format | Image format | string | PNG |
img.IsPortrait | If the image is portrait | bool | true |
img.IsLandscape | If the image is landscape | bool | false |
img.DateTaken | If available, full DateTime the image was taken | DateTime | 2020-04-23 12:00:23 |
img.DateTaken.Year | If available, year an image was taken | number | 2020 |
img.DateTaken.Month | If available, month an image was taken | number | 4 |
img.DateTaken.Day | If available, day an image was taken | number | 23 |
Move Files Based On Dates
If you wish to move a file to a folder based on the data it was taken.
Say, your base folder is D:\Pictures\Family Photos
You can use the Move File or Copy File flow element with the following parameters
Field | Value |
---|---|
Destination Folder | D:\Pictures\Family Photos\{img.DateTaken.Year}\{img.DateTaken.Month} |
This will move or copy the files to folders when a photo was taken.
If you may wish to first test if the DateTaken
is avilable first, in that case you can use a Function before the Move File or Copy File with the following code
return Variables.img?.DateTaken ? 1 : -1;
This will fail the flow if the DateTaken
does not exist. If you wish to instead call a second output instead, you can increase the Function outputs to 2
and then use this code instead
return Variables.img?.DateTaken ? 1 : 2;