Return either BIG_ENDIAN or LITTLE_ENDIAN depending on the endian indicator found in the TIFF `stream` header, either 'MM' or 'II'.
(cls, stream)
| 79 | |
| 80 | @classmethod |
| 81 | def _detect_endian(cls, stream): |
| 82 | """Return either BIG_ENDIAN or LITTLE_ENDIAN depending on the endian indicator |
| 83 | found in the TIFF `stream` header, either 'MM' or 'II'.""" |
| 84 | stream.seek(0) |
| 85 | endian_str = stream.read(2) |
| 86 | return BIG_ENDIAN if endian_str == b"MM" else LITTLE_ENDIAN |
| 87 | |
| 88 | def _dpi(self, resolution_tag): |
| 89 | """Return the dpi value calculated for `resolution_tag`, which can be either |
no test coverage detected