Return an |_App0Marker| instance for the APP0 marker at `offset` in `stream`.
(cls, stream, marker_code, offset)
| 314 | |
| 315 | @classmethod |
| 316 | def from_stream(cls, stream, marker_code, offset): |
| 317 | """Return an |_App0Marker| instance for the APP0 marker at `offset` in |
| 318 | `stream`.""" |
| 319 | # field off type notes |
| 320 | # ------------------ --- ----- ------------------- |
| 321 | # segment length 0 short |
| 322 | # JFIF identifier 2 5 chr 'JFIF\x00' |
| 323 | # major JPEG version 7 byte typically 1 |
| 324 | # minor JPEG version 8 byte typically 1 or 2 |
| 325 | # density units 9 byte 1=inches, 2=cm |
| 326 | # horz dots per unit 10 short |
| 327 | # vert dots per unit 12 short |
| 328 | # ------------------ --- ----- ------------------- |
| 329 | segment_length = stream.read_short(offset) |
| 330 | density_units = stream.read_byte(offset, 9) |
| 331 | x_density = stream.read_short(offset, 10) |
| 332 | y_density = stream.read_short(offset, 12) |
| 333 | return cls(marker_code, offset, segment_length, density_units, x_density, y_density) |
| 334 | |
| 335 | |
| 336 | class _App1Marker(_Marker): |
nothing calls this directly
no test coverage detected