If signature (header) has not been read then read and validate it; otherwise do nothing.
(self)
| 1584 | assert len(a) == 0 |
| 1585 | |
| 1586 | def validate_signature(self): |
| 1587 | """ |
| 1588 | If signature (header) has not been read then read and |
| 1589 | validate it; otherwise do nothing. |
| 1590 | """ |
| 1591 | |
| 1592 | if self.signature: |
| 1593 | return |
| 1594 | self.signature = self.file.read(8) |
| 1595 | if self.signature != signature: |
| 1596 | raise FormatError("PNG file has invalid signature.") |
| 1597 | |
| 1598 | def preamble(self, lenient=False): |
| 1599 | """ |
no test coverage detected