In a directory, how to find an image file with part of its filename is known
and the file extension could be one of the following(jpg, tiff, bmp,png).
The filename always begin between 1 to 3 alphabet, then a dash(-), and
between 1-4 set of numbers and the extension could be in one of the
following(in order of importance) - jpg, bmp, tif.
If I know part/full of its filename, find the 1st match(just in case there
are similar filename) with .jpg extension, if not found, then check with
..bmp extension, last check if it is with .tif extension.
If still not found, then display no-image.jpg and exit.
e.g:
AA-123 one.tif
AA-123 two.bmp
AA-123 two.jpg
AA-123.jpg
B-34.jpg
B-34xxxx.tif
B yyyy.jpg
....
....
and the file extension could be one of the following(jpg, tiff, bmp,png).
The filename always begin between 1 to 3 alphabet, then a dash(-), and
between 1-4 set of numbers and the extension could be in one of the
following(in order of importance) - jpg, bmp, tif.
If I know part/full of its filename, find the 1st match(just in case there
are similar filename) with .jpg extension, if not found, then check with
..bmp extension, last check if it is with .tif extension.
If still not found, then display no-image.jpg and exit.
e.g:
AA-123 one.tif
AA-123 two.bmp
AA-123 two.jpg
AA-123.jpg
B-34.jpg
B-34xxxx.tif
B yyyy.jpg
....
....
Comment