Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No metadata for each page from another multipage TIFF #648

Open
tburba opened this issue Jan 25, 2024 · 1 comment
Open

No metadata for each page from another multipage TIFF #648

tburba opened this issue Jan 25, 2024 · 1 comment
Labels
format-tiff help wanted image-queue Actionable issue with sample image

Comments

@tburba
Copy link

tburba commented Jan 25, 2024

Might be a duplicate of #223, however they didn't attach their sample file for regression tests etc.

This file was produced manually with tiffcp (libtiff 3.8.2, GnuWin32 port) from three images. Windows Photo Viewer shows every page. tiffinfo reports:

TIFF Directory at offset 0x1a1ce (106958)
  Image Width: 432 Image Length: 585
  Resolution: 72, 72 pixels/inch
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Rows/Strip: 160
  Planar Configuration: single image plane
  Software: IrfanView
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  JPEG Tables: (574 bytes)
TIFF Directory at offset 0x1d8a6 (120998)
  Image Width: 432 Image Length: 1170
  Resolution: 72, 72 pixels/inch
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Rows/Strip: 304
  Planar Configuration: single image plane
  Software: IrfanView
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  JPEG Tables: (574 bytes)
TIFF Directory at offset 0x217ea (137194)
  Image Width: 864 Image Length: 585
  Resolution: 72, 72 pixels/inch
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Rows/Strip: 160
  Planar Configuration: single image plane
  Software: IrfanView
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  JPEG Tables: (574 bytes)

But, when using the recent metadata-extractor 2.19, an MWE similar to one in that issue,

       Metadata m = ImageMetadataReader.readMetadata(new File("color-pages-jpg.tif"));
       for (Directory d : m.getDirectories()) {
            for (Tag t : d.getTags()) {
                System.out.println(t);
            }
        }

reveals only a single IFD0 (the first page) plus a single thumbnail (the third page):

[Exif IFD0] Image Width - 432 pixels
[Exif IFD0] Image Height - 585 pixels
[Exif IFD0] Bits Per Sample - 8 8 8 bits/component/pixel
[Exif IFD0] Compression - JPEG
[Exif IFD0] Photometric Interpretation - YCbCr
[Exif IFD0] Strip Offsets - 8 26663 60855 92871
[Exif IFD0] Orientation - Top, left side (Horizontal / normal)
[Exif IFD0] Samples Per Pixel - 3 samples/pixel
[Exif IFD0] Rows Per Strip - 160 rows/strip
[Exif IFD0] Strip Byte Counts - 26655 34192 32016 14087 bytes
[Exif IFD0] X Resolution - 72 dots per inch
[Exif IFD0] Y Resolution - 72 dots per inch
[Exif IFD0] Planar Configuration - Chunky (contiguous for each subsampling pixel)
[Exif IFD0] Resolution Unit - Inch
[Exif IFD0] Software - IrfanView
[Exif IFD0] JPEG Tables - [574 values]
[Exif IFD0] YCbCr Sub-Sampling - YCbCr4:2:0
[Exif IFD0] Reference Black/White - [0,128,128] [255,255,255]
[Exif Thumbnail] Image Width - 864 pixels
[Exif Thumbnail] Image Height - 585 pixels
[Exif Thumbnail] Bits Per Sample - 8 8 8 bits/component/pixel
[Exif Thumbnail] Compression - JPEG
[Exif Thumbnail] Photometric Interpretation - YCbCr
[Exif Thumbnail] Strip Offsets - 121906 124107 133439 135640
[Exif Thumbnail] Orientation - Top, left side (Horizontal / normal)
[Exif Thumbnail] Samples Per Pixel - 3 samples/pixel
[Exif Thumbnail] Rows Per Strip - 160 rows/strip
[Exif Thumbnail] Strip Byte Counts - 2201 9332 2201 1553 bytes
[Exif Thumbnail] X Resolution - 72 dots per inch
[Exif Thumbnail] Y Resolution - 72 dots per inch
[Exif Thumbnail] Planar Configuration - Chunky (contiguous for each subsampling pixel)
[Exif Thumbnail] Resolution Unit - Inch
[Exif Thumbnail] Software - IrfanView
[Exif Thumbnail] JPEG Tables - [574 values]
[Exif Thumbnail] YCbCr Sub-Sampling - YCbCr4:2:0
[Exif Thumbnail] Reference Black/White - [0,128,128] [255,255,255]
[File Type] Detected File Type Name - TIFF
[File Type] Detected File Type Long Name - Tagged Image File Format
[File Type] Detected MIME Type - image/tiff
[File Type] Expected File Name Extension - tiff
[File] File Name - color-pages-jpg.tif
[File] File Size - 138102 bytes
[File] File Modified Date - Thu Jan 25 14:55:10 +02:00 2024

The file is for a particular corner case: I need an efficient (metadata-based) way to detect that there are multiple pages and their dimensions differ.
color-pages-jpg.zip

@drewnoakes drewnoakes added help wanted format-tiff image-queue Actionable issue with sample image labels Jan 25, 2024
@drewnoakes
Copy link
Owner

Thanks for the clear report and sample image. This looks shovel-ready for someone to pick up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format-tiff help wanted image-queue Actionable issue with sample image
Projects
None yet
Development

No branches or pull requests

2 participants