code: @Override
      public ImageHeader readHeader(InputStream input) throws IOException
      {
          final long toSkip = 8L;
          final boolean bigEndian = 'M' == input.read();
          checkSkippedError(input.skip(HEADER_SIZE - 1L), HEADER_SIZE - 1);
          final int ifd = readInt(input, 4, bigEndian);
          input.skip(ifd - toSkip);
          // checkSkippedError(skipped, ifd - toSkip); fail when reading from JAR, not needed
          final int entries = readInt(input, 2, bigEndian);
  
          int width = -1;
          int height = -1;
          for (int i = 1; i <= entries; i++)
          {
              final int tag = readInt(input, 2, bigEndian);
              final int fieldType = readInt(input, 2, bigEndian);
              readInt(input, VAL_OFFSET_BYTES, bigEndian);
              final int valOffset;
              if (VAL_OFFSET_FIELD_1 == fieldType || VAL_OFFSET_FIELD_2 == fieldType)
              {
                  valOffset = readInt(input, 2, bigEndian);
                  final long skipped = input.skip(2);
                  checkSkippedError(skipped, 2);
              }
              else
              {
                  valOffset = readInt(input, VAL_OFFSET_BYTES, bigEndian);
              }
              if (TAG_WIDTH == tag)
              {
                  width = valOffset;
              }
              else if (TAG_HEIGHT == tag)
              {
                  height = valOffset;
              }
              if (-1 != width && -1 != height)
              {
                  return new ImageHeaderModel(width, height, ImageFormat.TIFF);
              }
          }
          throw new IOException(ERROR_TIFF);
      }
docs: /*
  ImageHeaderReader