mathiasbynens / mathiasbynens/small

TIFF is not valid

Open
#127 9 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
2.3k
Forks
192
PR merge metrics
No merged PRs in 30d

Description

TIFF added in #86 is not entirely valid, and both libtiff and ImageMagick complain about it.
```
$ tiffinfo tiff.tif
TIFFReadDirectory: Warning, TIFF directory is missing required "StripByteCounts" field, calculating from imagelength.
$ magick identify tiff.tif
identify: TIFF directory is missing required "StripByteCounts" field, calculating from imagelength. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/956.
identify: improper image header `tiff.tif' @ error/tiff.c/ReadTIFFImage/1349.
```
As I read the standard, it should add the StripByteCounts field, and terminate the IFD with a zero long to indicate no more IFDs.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the TIFF implementation associated with #86 and the generated tiff.tif file. Validate it with tiffinfo and ImageMagick, then confirm the StripByteCounts field is present and the IFD ends with a zero long indicating no more IFDs.

Written by the indexing model from the issue text.

Assessment

Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.