Return a |Png| instance having header properties parsed from image in `stream`.
(cls, stream)
| 20 | |
| 21 | @classmethod |
| 22 | def from_stream(cls, stream): |
| 23 | """Return a |Png| instance having header properties parsed from image in |
| 24 | `stream`.""" |
| 25 | parser = _PngParser.parse(stream) |
| 26 | |
| 27 | px_width = parser.px_width |
| 28 | px_height = parser.px_height |
| 29 | horz_dpi = parser.horz_dpi |
| 30 | vert_dpi = parser.vert_dpi |
| 31 | |
| 32 | return cls(px_width, px_height, horz_dpi, vert_dpi) |
| 33 | |
| 34 | |
| 35 | class _PngParser: |