I am trying to extract Metadata field from a TIFF file using GeoTools in Java, since I can't use GDAL to achieve that on the deployment platform.
I downloaded a TIFF sample file and used gdalinfo command from shell, getting this output:
Driver: GTiff/GeoTIFF
Files: path\to\file_example_TIFF_1MB.tiff
Size is 650, 434
Metadata:
TIFFTAG_DOCUMENTNAME=/home/user/Desktop/www/file ex/files/grafa/tiff/file_example_TIFF_1MB.tiff
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
TIFFTAG_XRESOLUTION=72.009003
TIFFTAG_YRESOLUTION=72.009003
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 434.0)
Upper Right ( 650.0, 0.0)
Lower Right ( 650.0, 434.0)
Center ( 325.0, 217.0)
Band 1 Block=650x64 Type=Byte, ColorInterp=Red
Mask Flags: PER_DATASET ALPHA
Band 2 Block=650x64 Type=Byte, ColorInterp=Green
Mask Flags: PER_DATASET ALPHA
Band 3 Block=650x64 Type=Byte, ColorInterp=Blue
Mask Flags: PER_DATASET ALPHA
Band 4 Block=650x64 Type=Byte, ColorInterp=Alpha
I was able to fetch every other field using GeoTools, but I can't retrieve the Metadata field.
Is there a way to do it?