HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/sphinx/util/__pycache__/png.cpython-310.pyc
o


$�aA�@sldZddlZddlZddlmZdZdZe�dd�ZdZ	d	Z
d
edeefdd
�Z
d
ededdfdd�ZdS)z�
    sphinx.util.png
    ~~~~~~~~~~~~~~~

    PNG image manipulation helpers.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�Optional���!i�
s
tEXtDepthsIEND�B`��filename�returncCs�t|d��2}|�ttd�|�t�}|�tt�s$	Wd�dSt�	d|dd��dWd�S1s:wYdS)zARead the special tEXt chunk indicating the depth from a PNG file.�rb�Nr��r)
�open�seek�LEN_IEND�	LEN_DEPTH�read�
startswith�DEPTH_CHUNK_LEN�DEPTH_CHUNK_START�struct�unpack)r�f�
depthchunk�r�1/usr/lib/python3/dist-packages/sphinx/util/png.py�read_png_depths
�$�r�depthcCs�t�d|�}t|d��0}|�td�|�tt|�t�	t|�d@}|�t�d|��|�t
�Wd�dS1s>wYdS)z�Write the special tEXt chunk indicating the depth to a PNG file.

    The chunk is placed immediately before the special IEND chunk.
    rzr+br
l��z!IN)r�packr
rr�writerr�binascii�crc32�
IEND_CHUNK)rr�datar�crcrrr�write_png_depth#s"�r$)�__doc__rr�typingrrrrrrr!�str�intrr$rrrr�<module>s