Process the next chunk and its data. This only processes the following chunk types: ``IHDR``, ``PLTE``, ``bKGD``, ``tRNS``, ``gAMA``, ``sBIT``, ``pHYs``. All other chunk types are ignored. If the optional `lenient` argument evaluates to `True`, check
(self, lenient=False)
| 1642 | return length, type |
| 1643 | |
| 1644 | def process_chunk(self, lenient=False): |
| 1645 | """ |
| 1646 | Process the next chunk and its data. |
| 1647 | This only processes the following chunk types: |
| 1648 | ``IHDR``, ``PLTE``, ``bKGD``, ``tRNS``, ``gAMA``, ``sBIT``, ``pHYs``. |
| 1649 | All other chunk types are ignored. |
| 1650 | |
| 1651 | If the optional `lenient` argument evaluates to `True`, |
| 1652 | checksum failures will raise warnings rather than exceptions. |
| 1653 | """ |
| 1654 | |
| 1655 | type, data = self.chunk(lenient=lenient) |
| 1656 | method = "_process_" + type.decode("ascii") |
| 1657 | m = getattr(self, method, None) |
| 1658 | if m: |
| 1659 | m(data) |
| 1660 | |
| 1661 | def _process_IHDR(self, data): |
| 1662 | # http://www.w3.org/TR/PNG/#11IHDR |