| Server IP : 217.160.0.135 / Your IP : 216.73.217.37 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/reportlab/pdfgen/__pycache__/ |
Upload File : |
�
~G�b � �� � d Z dZddlZddlZddlmZ ddlmZ ddlmZ ddlm Z ddl
mZmZ dd l
mZ G d
� d� � Zedk r�ej � ej � ej � � d
d� � Zej � e� � s
J d� � �de_ eedd� � Z ej � � Z edej � � ee� e� � � � dS dS )z3.3.0z@
Image functionality sliced out of canvas.py for generalization
� N)� rl_config)�pdfutils)�pdfdoc)�isStr)�fp_str�asciiBase85Encode)�aspectRatioFixc �N � e Zd ZdZdd�Zd� Zd� Zd� Zd� Zd � Z dd�Z
dd
�Zd� ZdS )�PDFImagez�Wrapper around different "image sources". You can make images
from a PIL Image object, a filename (in which case it uses PIL),
an image we previously cached (optimisation, hardly used these
days) or a JPEG (which PDF supports natively).Nr c �� � || _ || _ || _ || _ || _ d | _ || _ d| _ d| _ g | _ d | _
| � � � d S )N� DeviceRGB� )�image�x�y�width�height�filename�imageCaching�
colorSpace�bitsPerComponent�filters�source�getImageData)�selfr r r r r �cachings �</usr/lib/python3/dist-packages/reportlab/pdfgen/pdfimages.py�__init__zPDFImage.__init__ sk � ���
���������
������
�#��� &��� !����������������� c � � t | j d� � } | � |� � }|� � � n# |� � � w xY w|S )N�rb)�openr �_jpg_imagedata�close)r �fp�results r �
jpg_imagedatazPDFImage.jpg_imagedata* sS � � �$�*�d�
#�
#�� ��(�(��,�,�F��H�H�J�J�J�J��B�H�H�J�J�J�J�����
s �A �Ac �� � t j |� � }d| _ |d |d }}|d dk rd}n|d dk rd}nd}|� d� � g }|� d |||t
j rd
pdfz � � |� � � }t
j rt |� � }t j ||� � |� d� � |||fS )
N�JPEGr � � �
DeviceGray� r
�
DeviceCMYKz,BI /W %d /H %d /BPC 8 /CS /%s /F [%s/DCT] ID�/A85 � �EI)
r �readJPEGInfor �seek�appendr �useA85�readr �_chunker)r � imageFile�info�imgwidth� imgheightr � imagedata�datas r r# zPDFImage._jpg_imagedata4 s � ��$�Y�/�/�����"�1�g�t�A�w�)����7�a�<�<�%�J�J�
�!�W��\�\�$�J�J�%�J����q����� ����G�8�U^�`j�lu�l|� mI� BI� mO� MO� KP� P� Q� Q� Q��~�~������ +�$�T�*�*�D���$�y�)�)�)���������8�Y�/�/r c �b � | j }t j |� � st j |� � t j � |� � d t j rdpdz }t |d� � �
� � }t t t j |� � � � }|S )Nr z.a85z.binr! )r r �cachedImageExists�cacheImageFile�os�path�splitextr r5 r"