403Webshell
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/PIL/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/PIL/__pycache__/ImageFile.cpython-39.pyc
a

h�a�R�@s�ddlZddlZddlZddlZddlmZddlmZdZdZ	dZ
dd	d
ddd
�Zdd�Zdd�Z
dd�ZGdd�dej�ZGdd�de�ZGdd�d�Zd"dd�Zdd�ZGdd�d�ZGd d!�d!�ZdS)#�N�)�Image)�isPathiiFzimage buffer overrun errorzdecoding errorz
unknown errorzbad configurationzout of memory error)���������i����i����cCsLztj�|�}Wnty,t�|�}Yn0|s<d|��}t|d��dS)Nzdecoder error z when reading image file)r�coreZgetcodecstatus�AttributeError�ERRORS�get�OSError)�error�message�r�1/usr/lib/python3.9/site-packages/PIL/ImageFile.py�
raise_oserror<s
rcCst�dt�t|�S)Nzdraise_ioerror is deprecated and will be removed in Pillow 9 (2022-01-02). Use raise_oserror instead.)�warnings�warn�DeprecationWarningr)r
rrr�
raise_ioerrorFs
�rcCs|dS)N�r)�trrr�	_tilesortOsrcsReZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
�ZS)�	ImageFilez*Base class for image file format handlers.Ncs�t���d|_d|_d|_d|_d|_t|_t	|�rPt
|d�|_||_d|_
n||_||_d|_
zhz|��Wn:tttttjfy�}zt|�|�WYd}~n
d}~00|jr�|jddkr�td��Wn$ty�|j
r�|j���Yn0dS)Nrrr�rbTznot identified by this driver)�super�__init__�
_min_frame�custom_mimetype�tile�readonly�
decoderconfig�MAXBLOCK�decodermaxblockr�open�fp�filename�
_exclusive_fp�_open�
IndexError�	TypeError�KeyError�EOFError�structr
�SyntaxError�mode�size�
BaseException�close)�selfr%r&�v��	__class__rrr\s>
� 
zImageFile.__init__cCs,|jr|jS|jdur(tj�|j���SdS�N)r�formatrZMIMEr�upper�r3rrr�get_format_mimetype�s
zImageFile.get_format_mimetypecCs|jr|j��d|_dS)zCheck file integrityN)r'r%r2r:rrr�verify�s
zImageFile.verifycCsz|jdurtd��tj�|�}|js(|Sd|_|jo@t|j�dk}|oPttd�}d}z|j	}d}Wnt
y~|jj}Yn0z|j
}d}Wnt
y�|jj}Yn0|�r�|jd\}}}}	|dk�r�t|	�dk�r�|	d|jk�r�|	dtjv�r�z~ddl}
t|j��(}|
j|��d|
jd	�|_Wd�n1�s>0Ytj�|j|j|||	�|_d}|j�rvd|j_Wn t
ttf�y�d|_Yn0|��d
}|j�s|jjtd�z
|j}
Wnt
�y�d}
Yn0|jD�]0\}}}}	t� |j||	|j!�}�z||�|�"|j|�|j#�rF|�$|j�|�%d�\}}n�|
}z||j&�}WnLt't(j)f�y�}z,t*�r�WYd}~�qn
td
�|�WYd}~n
d}~00|�s�t*�r��qntdt|��d���||}|�%|�\}}|dk�r�q||d�}�qJW|�+�n
|�+�0�q�g|_||_,|�-�|j.�rH|j/�rH|j�0�d|_|j�snt*�sn|dk�rnt1|�tj�|�S)z"Load image data based on tile listNzcannot load this imagerZpypy_version_inforF�raw�)�accessr��key�zimage file is truncatedzimage file is truncated (z bytes not processed))2rrr�load�mapr&�len�hasattr�sys�	load_readr	r%�read�	load_seek�seekr/Z	_MAPMODES�mmapr$�filenoZACCESS_READrZ
map_bufferr0�imZpaletteZdirty�ImportError�load_prepare�sortrZtile_prefix�_getdecoderr!�setimage�pulls_fd�setfd�decoder#r)r-r
�LOAD_TRUNCATED_IMAGES�cleanupr �load_endr'Z!_close_exclusive_fp_after_loadingr2r)r3ZpixelZuse_mmapr rIrKZdecoder_name�extents�offset�argsrLr%Zerr_code�prefix�decoder�status�b�s�e�nrrrrC�s�
�
���8�

� ��

zImageFile.loadcCsP|jr"|jj|jks"|jj|jkr6tj�|j|j�|_|jdkrLtj�|�dS)N�P)rNr/r0rr�newrCr:rrrrPs"
zImageFile.load_preparecCsdSr7rr:rrrrYszImageFile.load_endcCsB||jks.t|d�r|jdus6||j|jkr6td��|��|kS)N�	_n_framesz attempt to seek outside sequence)rrFrfZn_framesr,�tell)r3�framerrr�_seek_check*s����	zImageFile._seek_check)NN)�__name__�
__module__�__qualname__�__doc__rr;r<rCrPrYri�
__classcell__rrr5rrYs/	|rc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
StubImageFilez�
    Base class for stub image loaders.

    A stub loader is an image loader that can identify files of a
    certain format, but relies on external code to load the file.
    cCstd��dS)Nz+StubImageFile subclass must implement _open��NotImplementedErrorr:rrrr(AszStubImageFile._opencCsL|��}|dur"td|j�d���|�|�}|dus8J�|j|_|j|_dS)Nzcannot find loader for this z file)�_loadrr8rCr6�__dict__)r3�loader�imagerrrrCDs
zStubImageFile.loadcCstd��dS)z (Hook) Find actual image loader.z+StubImageFile subclass must implement _loadNrpr:rrrrrNszStubImageFile._loadN)rjrkrlrmr(rCrrrrrrro9s
roc@sPeZdZdZdZdZdZdZdZdZ	dd�Z
dd�Zdd	�Zd
d�Z
dd
�ZdS)�Parserzj
    Incremental image parser.  This class implements the standard
    feed/close consumer interface.
    NrcCs|jdusJd��dS)z�
        (Consumer) Reset the parser.  Note that you can only call this
        method immediately after you've created a parser; parser
        instances cannot be reused.
        Nzcannot reuse parsers)�datar:rrr�reset`szParser.resetcCs�|jr
dS|jdur||_n|j||_|jr�|jdkrztt|j�|j�}|j|d�|_|j||_|jdksv|jszdS|j�|j�\}}|dkr�d|_d|_|dkr�d|_t|�ndS|j|d�|_�n|jrڐnz<t	�
|j��}t�|�}Wd�n1�s
0YWnt
�y*Yn�0t|d��p@t|d�}|�sXt|j�dk�r`d|_nv|��|jd\}}}	}
g|_t�|j||
|j�|_|j�|j|�|	|_|jt|j�k�r�|j|jd�|_d|_||_dS)z�
        (Consumer) Feed data to the parser.

        :param data: A string buffer.
        :exception OSError: If the parser failed to parse the image file.
        NrrrJrH)�finishedrwr^r[�minrErVrur�io�BytesIOrr$rrFrrPrRr/r!rSrN)r3rw�skiprcrbr%rN�flag�d�o�arrr�feedhsR	


.zParser.feedcCs|Sr7rr:rrr�	__enter__�szParser.__enter__cGs|��dSr7)r2�r3r\rrr�__exit__�szParser.__exit__c	Cs�|jr*|�d�d|_|_|js*td��|js8td��|jr�t�|j��8}zt�	|�|_W|j�
�n|j�
�0Wd�n1s�0Y|jS)a
        (Consumer) Close the stream.

        :returns: An image object.
        :exception OSError: If the parser failed to parse the image file either
                            because it cannot be identified or cannot be
                            decoded.
        rBNzimage was incompletezcannot parse this image)r^r�rwryrrur{r|rr$rC)r3r%rrrr2�s

6zParser.close)rjrkrlrmZincrementalrurwr^r[ryrxr�r�r�r2rrrrrvSsPrvc
Cs$|��t|d�sd|_|jtd�tt||jdd�}z|tj	kpP|tj	j
k}Wnttfynd}Yn0|r�|�
�dSz|��}|�
�Wn�ttjf�yr}z�|D]�\}}}	}
t�|j||
|j�}|	dkr�|�|	�|�|j|�|j�r|�|�|��\}}n(|�|�\}}}
|�|
�|�r�q8�q|dk�rTtd|�d	��|�|��q�WYd}~n�d}~00|D]�\}}}	}
t�|j||
|j�}|	dk�r�|�|	�|�|j|�|j�r�|�|�|��\}}n|�||�}|dk�rtd|�d	���|���qxt|d
��r |�
�dS)z�Helper to save image based on tile list

    :param im: Image object.
    :param fp: File object.
    :param tile: Tile list.
    :param bufsize: Optional buffer size
    �
encoderconfigrr@r�FNzencoder error z when writing image file�flush)rCrFr�rQr�maxr"r0rG�stdout�bufferrr	r�rMr{�UnsupportedOperationrZ_getencoderr/rKrSrNZ	pushes_fdrUZencode_to_pyfd�encode�writerXZencode_to_file)rNr%r�bufsizer�Zfh�excrbr`r�r��lrarrrr�_save�sZ	





 



r�cCs�|dkrdS|tkr6|�|�}t|�|kr2td��|Sg}|dkrp|�t|t��}|sXqp|�|�|t|�8}q:tdd�|D��|kr�td��d�|�S)a�
    Reads large blocks in a safe way.  Unlike fp.read(n), this function
    doesn't trust the user.  If the requested size is larger than
    SAFEBLOCK, the file is read block by block.

    :param fp: File handle.  Must implement a <b>read</b> method.
    :param size: Number of bytes to read.
    :returns: A string containing <i>size</i> bytes of data.

    Raises an OSError if the file is truncated and the read cannot be completed

    rrBzTruncated File Readcss|]}t|�VqdSr7)rE)�.0rrrr�	<genexpr>;rBz_safe_read.<locals>.<genexpr>)�	SAFEBLOCKrIrErrz�append�sum�join)r%r0rw�blockrrr�
_safe_read s"


r�c@seZdZdd�Zdd�ZdS)�PyCodecStatecCsd|_d|_d|_d|_dS)Nr)�xsize�ysize�xoff�yoffr:rrrrAszPyCodecState.__init__cCs |j|j|j|j|j|jfSr7)r�r�r�r�r:rrrrZGszPyCodecState.extentsN)rjrkrlrrZrrrrr�@sr�c@s\eZdZdZdZdd�Zdd�Zedd��Zd	d
�Z	dd�Z
d
d�Zddd�Zddd�Z
dS)�	PyDecoderz�
    Python implementation of a format decoder. Override this class and
    add the decoding logic in the :meth:`decode` method.

    See :ref:`Writing Your Own File Decoder in Python<file-decoders-py>`
    FcGs(d|_t�|_d|_||_|�|�dSr7)rNr��state�fdr/�init)r3r/r\rrrrUs
zPyDecoder.__init__cCs
||_dS)z�
        Override to perform decoder specific initialization

        :param args: Array of args items from the tile entry
        :returns: None
        N)r\r�rrrr�\szPyDecoder.initcCs|jSr7)�	_pulls_fdr:rrrrTeszPyDecoder.pulls_fdcCs
t��dS)a=
        Override to perform the decoding process.

        :param buffer: A bytes object with the data to be decoded.
        :returns: A tuple of ``(bytes consumed, errcode)``.
            If finished with decoding return <0 for the bytes consumed.
            Err codes are from :data:`.ImageFile.ERRORS`.
        Nrp)r3r�rrrrVis	zPyDecoder.decodecCsdS)zV
        Override to perform decoder specific cleanup

        :returns: None
        Nrr:rrrrXtszPyDecoder.cleanupcCs
||_dS)z�
        Called from ImageFile to set the python file-like object

        :param fd: A python file-like object
        :returns: None
        N)r�)r3r�rrrrU|szPyDecoder.setfdNcCs�||_|r|\}}}}nd\}}}}|dkrJ|dkrJ|jj\|j_|j_n(||j_||j_|||j_|||j_|jjdks�|jjdkr�td��|jj|jj|jjdks�|jj|jj|jjdkr�td��dS)z�
        Called from ImageFile to set the core output image for the decoder

        :param im: A core image object
        :param extents: a 4 tuple of (x0, y0, x1, y1) defining the rectangle
            for this tile
        :returns: None
        )rrrrrzSize cannot be negativerz Tile cannot extend outside imageN)rNr0r�r�r�r�r��
ValueError)r3rNrZZx0Zy0Zx1Zy1rrrrS�s"��zPyDecoder.setimagecCsd|s
|j}t�|jd|�}|�|j|j���|�|�}|ddkrLtd��|ddkr`td��dS)a
        Convenience method to set the internal image from a stream of raw data

        :param data: Bytes to be set
        :param rawmode: The rawmode to be used for the decoder.
            If not specified, it will default to the mode of the image
        :returns: None
        r=rznot enough image datarzcannot decode image dataN)	r/rrRrSrNr�rZrVr�)r3rwZrawmoderrarrr�
set_as_raw�s

zPyDecoder.set_as_raw)N)N)rjrkrlrmr�rr��propertyrTrVrXrUrSr�rrrrr�Ks	
	
#r�)r)r{r-rGr�rZ_utilrr"r�rWr
rrrrrorvr�r�r�r�rrrr�<module>s4�
	
a
B 

Youez - 2016 - github.com/yon3zu
LinuXploit