read the (width, height) from a PNG header
(data)
| 1063 | _JPEG = b'\xff\xd8' |
| 1064 | |
| 1065 | def _pngxy(data): |
| 1066 | """read the (width, height) from a PNG header""" |
| 1067 | ihdr = data.index(b'IHDR') |
| 1068 | # next 8 bytes are width/height |
| 1069 | return struct.unpack('>ii', data[ihdr+4:ihdr+12]) |
| 1070 | |
| 1071 | def _jpegxy(data): |
| 1072 | """read the (width, height) from a JPEG header""" |
no outgoing calls
no test coverage detected