У меня есть один файл TIFF с несколькими изображениями внутри.Я хочу извлечь значение Описание изображения для каждого из изображений.Я не уверен почему, но когда я использую ImageMetaDataReader
, он возвращает только первое и последнее описание изображения.Я проверил данные там, используя exiftool и дамп в дерево XML.Любые предложения, почему это не работает?
Metadata metadata = ImageMetadataReader.readMetadata(createInputFile());
for (Directory directory : metadata.getDirectories())
{
for (Tag tag : directory.getTags())
{
fileWriter.write(String.format(tag + "%n"));
}
}
Все теги с использованием экстрактора метаданных
[Exif IFD0] New Subfile Type - Full-resolution image
[Exif IFD0] Image Width - 1254 pixels
[Exif IFD0] Image Height - 558 pixels
[Exif IFD0] Bits Per Sample - 1 bits/component/pixel
[Exif IFD0] Compression - T6/Group 4 Fax
[Exif IFD0] Photometric Interpretation - WhiteIsZero
[Exif IFD0] Fill Order - Normal
[Exif IFD0] Image Description - 12345
[Exif IFD0] Strip Offsets - 399
[Exif IFD0] Orientation - Top, left side (Horizontal / normal)
[Exif IFD0] Samples Per Pixel - 1 samples/pixel
[Exif IFD0] Rows Per Strip - 558 rows/strip
[Exif IFD0] Strip Byte Counts - 7899 bytes
[Exif IFD0] Minimum Sample Value - 0
[Exif IFD0] Maximum Sample Value - 1
[Exif IFD0] X Resolution - 200 dots per inch
[Exif IFD0] Y Resolution - 200 dots per inch
[Exif IFD0] Planar Configuration - Chunky (contiguous for each subsampling pixel)
[Exif IFD0] Unknown tag (0x0125) - 0
[Exif IFD0] Resolution Unit - Inch
[Exif Thumbnail] New Subfile Type - Full-resolution image
[Exif Thumbnail] Image Width - 1253 pixels
[Exif Thumbnail] Image Height - 558 pixels
[Exif Thumbnail] Bits Per Sample - 1 bits/component/pixel
[Exif Thumbnail] Compression - T6/Group 4 Fax
[Exif Thumbnail] Photometric Interpretation - WhiteIsZero
[Exif Thumbnail] Fill Order - Normal
[Exif Thumbnail] Image Description - 12345
[Exif Thumbnail] Strip Offsets - 38596
[Exif Thumbnail] Orientation - Top, left side (Horizontal / normal)
[Exif Thumbnail] Samples Per Pixel - 1 samples/pixel
[Exif Thumbnail] Rows Per Strip - 558 rows/strip
[Exif Thumbnail] Strip Byte Counts - 1288 bytes
[Exif Thumbnail] Minimum Sample Value - 0
[Exif Thumbnail] Maximum Sample Value - 1
[Exif Thumbnail] X Resolution - 200 dots per inch
[Exif Thumbnail] Y Resolution - 200 dots per inch
[Exif Thumbnail] Planar Configuration - Chunky (contiguous for each subsampling pixel)
[Exif Thumbnail] Unknown tag (0x0125) - 0
[Exif Thumbnail] Resolution Unit - Inch
[File Type] Detected File Type Name - ARW
[File Type] Detected File Type Long Name - Sony Camera Raw
[File Type] Expected File Name Extension - arw
[File] File Name - test_images.tif
[File] File Size - 39884 bytes
[File] File Modified Date - Wed Apr 10 08:51:24 -02:30 2019
All tags using Exiftool.
ExifTool Version Number : 11.44
File Name : test_images.tif
Directory : .
File Size : 39 kB
File Modification Date/Time : 2019:04:10 08:51:24-02:30
File Access Date/Time : 2019:06:17 16:04:44-02:30
File Inode Change Date/Time : 2019:06:17 15:16:47-02:30
File Permissions : rwxr-xr-x
File Type : TIFF
File Type Extension : tif
MIME Type : image/tiff
Exif Byte Order : Little-endian (Intel, II)
Subfile Type : Full-resolution Image
Image Width : 1254
Image Height : 558
Bits Per Sample : 1
Compression : T6/Group 4 Fax
Photometric Interpretation : WhiteIsZero
Fill Order : Normal
Image Description : 12345
Strip Offsets : 399
Orientation : Horizontal (normal)
Samples Per Pixel : 1
Rows Per Strip : 558
Strip Byte Counts : 7899
Min Sample Value : 0
Max Sample Value : 1
X Resolution : 200
Y Resolution : 200
Planar Configuration : Chunky
T6 Options : (none)
Resolution Unit : inches
Subfile Type : Full-resolution Image
Image Width : 1253
Image Height : 558
Bits Per Sample : 1
Compression : T6/Group 4 Fax
Photometric Interpretation : WhiteIsZero
Fill Order : Normal
Image Description : 12345
Strip Offsets : 8689
Orientation : Horizontal (normal)
Samples Per Pixel : 1
Rows Per Strip : 558
Strip Byte Counts : 1288
Min Sample Value : 0
Max Sample Value : 1
X Resolution : 200
Y Resolution : 200
Planar Configuration : Chunky
T6 Options : (none)
Resolution Unit : inches
Subfile Type : Full-resolution Image
Image Width : 1254
Image Height : 558
Bits Per Sample : 1
Compression : T6/Group 4 Fax
Photometric Interpretation : WhiteIsZero
Fill Order : Normal
Image Description : 12345
Strip Offsets : 10368
Orientation : Horizontal (normal)
Samples Per Pixel : 1
Rows Per Strip : 558
Strip Byte Counts : 7899
Min Sample Value : 0
Max Sample Value : 1
X Resolution : 200
Y Resolution : 200
Planar Configuration : Chunky
T6 Options : (none)
Resolution Unit : inches
Subfile Type : Full-resolution Image
Image Width : 1253
Image Height : 558
Bits Per Sample : 1
Compression : T6/Group 4 Fax
Photometric Interpretation : WhiteIsZero
Fill Order : Normal
Image Description : 12345
Strip Offsets : 18658
Orientation : Horizontal (normal)
Samples Per Pixel : 1
Rows Per Strip : 558
Strip Byte Counts : 1288
Min Sample Value : 0
Max Sample Value : 1
X Resolution : 200
Y Resolution : 200
Planar Configuration : Chunky
T6 Options : (none)
Resolution Unit : inches
Subfile Type : Full-resolution Image
Image Width : 1254
Image Height : 558
Bits Per Sample : 1
Compression : T6/Group 4 Fax
Photometric Interpretation : WhiteIsZero
Fill Order : Normal
Image Description : 12345
Strip Offsets : 20337
Orientation : Horizontal (normal)
Samples Per Pixel : 1
Rows Per Strip : 558
Strip Byte Counts : 7899
Min Sample Value : 0
Max Sample Value : 1
X Resolution : 200
Y Resolution : 200
Planar Configuration : Chunky
T6 Options : (none)
Resolution Unit : inches
Subfile Type : Full-resolution Image
Image Width : 1253
Image Height : 558
Bits Per Sample : 1
Compression : T6/Group 4 Fax
Photometric Interpretation : WhiteIsZero
Fill Order : Normal
Image Description : 12345
Strip Offsets : 28627
Orientation : Horizontal (normal)
Samples Per Pixel : 1
Rows Per Strip : 558
Strip Byte Counts : 1288
Min Sample Value : 0
Max Sample Value : 1
X Resolution : 200
Y Resolution : 200
Planar Configuration : Chunky
T6 Options : (none)
Resolution Unit : inches
Subfile Type : Full-resolution Image
Image Width : 1254
Image Height : 558
Bits Per Sample : 1
Compression : T6/Group 4 Fax
Photometric Interpretation : WhiteIsZero
Fill Order : Normal
Image Description : 12345
Strip Offsets : 30306
Orientation : Horizontal (normal)
Samples Per Pixel : 1
Rows Per Strip : 558
Strip Byte Counts : 7899
Min Sample Value : 0
Max Sample Value : 1
X Resolution : 200
Y Resolution : 200
Planar Configuration : Chunky
T6 Options : (none)
Resolution Unit : inches
Subfile Type : Full-resolution Image
Image Width : 1253
Image Height : 558
Bits Per Sample : 1
Compression : T6/Group 4 Fax
Photometric Interpretation : WhiteIsZero
Fill Order : Normal
Image Description : 12345
Strip Offsets : 38596
Orientation : Horizontal (normal)
Samples Per Pixel : 1
Rows Per Strip : 558
Strip Byte Counts : 1288
Min Sample Value : 0
Max Sample Value : 1
X Resolution : 200
Y Resolution : 200
Planar Configuration : Chunky
T6 Options : (none)
Resolution Unit : inches
Image Size : 1254x558
Megapixels : 0.700