To read image metadata, the basic process I know is as follows:
- Read the whole file from its path (
[image_path]
):
Dim ImScan = Image.FromStream(New IO.MemoryStream(IO.File.ReadAllBytes([image_path])))
- Get the desired metadata characterized by its ID (
[PropItem_ID]
) with theGetPropertyItem
function as :
Dim propItem As Imaging.PropertyItem = ImScan.GetPropertyItem([PropItem_ID])
Performance problems appear with this workflow when you need to parse through a large number of images. Loading the entire file for each image just to grab a small part of information seems to be non-optimized and shows rather poor performance.
Is there a way to read the metadata part of an image file only? I did not find any relevant methods in the System.IO.File
class.
Thanks for your support.