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

Add support for bigtiff #187

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

jmigueldelgado
Copy link

In this PR:

  • replace hard-coded numbers with variables
  • encode lengths and offsets for bigtiff

Copy link

@Geosynopsis Geosynopsis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmigueldelgado Great PR! 🎉 I have a few comments. As a general remark, there are a lot of formatting changes unrelated to the PR, perhaps adjusting the local formatting of this project might help to resolve it.

test.py Outdated

BIG_TIFF_PACKAGE: str = "compressed_asset.large.zip"
TIFF_PACKAGE: str = "compressed_asset.zip"
PARENT_PATH: str = "/Users/jose.delgado/delivery_data"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: ‏Please remove the information from the local file system.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file went unintendendly into the PR, will remove.

test.py Outdated
for key, value in header.items():
if value.tag == 34737:
print(value.values)
# print(header)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: ‏Code comment

test.py Outdated
Comment on lines 22 to 55
"""
Struggling with the following byte string: b'E\x00\x00\x7fC\xb0\xd4\x00'

- `E` is a shift-out character with no practical use https://en.wikipedia.org/wiki/Shift_Out_and_Shift_In_characters
- `\x7f` is a delete charater https://en.wikipedia.org/wiki/Delete_character
- `C` is form feed, or page break https://en.wikipedia.org/wiki/Page_break
- `\x00` is NULL and every ASCII string should end in a NULL

So the byte string should break into something like:
b'\x00\x00'
b'\xb0\xd4\x00'

Also from the tiff specification:

Note on ASCII Keys:

Special handling is required for
ASCII-valued keys. While it is true that
TIFF 6.0 permits multiple NULL-delimited
strings within a single ASCII tag, the secondary
strings might not appear in the output of naive "tiffdump"
programs. For this reason, the null delimiter of each
ASCII Key value shall be converted to
a "|" (pipe) character before being
installed back into the ASCII holding
tag, so that a dump of the tag will look like this.

"|" is b'\x7c' in hex

values.replace(b'b'\x7c',)

AsciiTag="first_value|second_value|etc...last_value|"

"""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: ‏Add file like note.txt or something to collect those notes.

if next_ifd == ifd:
return 0
return next_ifd

def list_ifd(self) -> list:
"""Return the list of IFDs in the header."""
i = self._first_ifd()
# i = 16

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: ‏Code comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants