| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/sphinx/util/__pycache__/ |
Upload File : |
a
�abA � @ sf d Z ddlZddlZddlmZ dZdZe�dd�ZdZ d Z
eee d
�dd�Z
eedd
�dd�ZdS )z�
sphinx.util.png
~~~~~~~~~~~~~~~
PNG image manipulation helpers.
:copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
� N)�Optional� � �!i�
s
tEXtDepth s IEND�B`�)�filename�returnc C s� t | d��p}|�tt d� |�t�}|�tt �sFW d � dS t� d|dd� �d W d � S W d � n1 s�0 Y dS )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 �fZ
depthchunk� r �3/usr/lib/python3.9/site-packages/sphinx/util/png.py�read_png_depth s
r )r �depthr c C s� t �d|�}t| d��^}|�t d� |�tt | � t� t| �d@ }|�t �d|�� |�t
� W d � n1 sz0 Y dS )z�Write the special tEXt chunk indicating the depth to a PNG file.
The chunk is placed immediately before the special IEND chunk.
r zr+br
l �� z!IN)r �packr
r r �writer r �binascii�crc32�
IEND_CHUNK)r r �datar �crcr r r �write_png_depth# s r# )�__doc__r r �typingr r r r r r r �str�intr r# r r r r �<module> s