Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 ia˜Rã @sÖddlZddlZddlZddlZddlmZddlmZdZd%Z dZ d&dd'd d(d d)dd*diZ dd„Z dd„Z dd„ZGdd„dejƒZGdd„deƒZGdd„dƒZd+dd„Zdd „ZGd!d"„d"ƒZGd#d$„d$ƒZdS),éNé)ÚImage)ÚisPathiiFzimage buffer overrun errorézdecoding erroréz unknown errorézbad configurationé zout of memory errorc CsNytjj|ƒ}Wntk r.tj|ƒ}YnX|s>d|›�}t|dƒ‚dS)Nzdecoder error z when reading image file)rÚcoreZgetcodecstatusÚAttributeErrorÚERRORSÚgetÚOSError)ÚerrorÚmessage©rú./tmp/tmp5hum_rxs/lib64/python/PIL/ImageFile.pyÚ raise_oserror<s rcCstjdtƒt|ƒS)Nzdraise_ioerror is deprecated and will be removed in Pillow 9 (2022-01-02). Use raise_oserror instead.)ÚwarningsÚwarnÚDeprecationWarningr)rrrrÚ raise_ioerrorFsrcCs|dS)Nrr)ÚtrrrÚ _tilesortOsrcsReZdZdZd‡fdd„ Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z ‡Z S)Ú ImageFilez*Base class for image file format handlers.Ncsötƒjƒd|_d|_d|_d|_f|_t|_t |ƒrPt |dƒ|_ ||_ d|_ n||_ ||_ d|_ yhy |jƒWn8tttttjfk r¨}zt|ƒ|‚WYdd}~XnX|j sÀ|jddkrÈtdƒ‚Wn&tk rð|j rê|j jƒ‚YnXdS)NrrÚ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|jdk r(tjj|jjƒƒSdS)N)rÚformatrZMIMEr Úupper)r3rrrÚget_format_mimetype‹s zImageFile.get_format_mimetypecCs|jr|jjƒd|_dS)zCheck file integrityN)r'r%r2)r3rrrÚverify‘s zImageFile.verifyc>CsX|jdkrtdƒ‚tjj|ƒ}|js(|Sd|_|jo@t|jƒdk}|oPttdƒ }d}y|j }d}Wnt k r€|j j }YnXy|j }d}Wnt k r¬|j j}YnX|�r„|jd\}}}} |dkoôt| ƒdkoô| d|jkoô| dtjk�r„yhddl} t|jƒ�} | j| jƒd| jd �|_WdQRXtjj|j|j||| ƒ|_d}|j�r^d|j_Wn"t ttfk �r‚d|_YnX|jƒd} |j�sô|jjtd �y |j} Wnt k �rÊd } YnX�x$|jD�]\}}}} tj |j|| |j!ƒ}zê||ƒ|j"|j|ƒ|j#�r4|j$|j ƒ|j%d ƒ\}} n¬| }x¦y||j&ƒ}Wn>t't(j)fk �r†}zt*�rlPn td ƒ|‚WYdd}~XnX|�s¬t*�r˜Pntd t|ƒ›d�ƒ‚||}|j%|ƒ\}} |dk�rÎP||d…}�q:WWd|j+ƒX�qÖWg|_||_,|j-ƒ|j.�r"|j/�r"|j j0ƒd|_ |j �rLt* �rL| dk�rLt1| ƒtjj|ƒS)z"Load image data based on tile listNzcannot load this imagerÚpypy_version_inforFÚrawr)Úaccess)Ú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$ÚfilenoZ ACCESS_READr Z map_bufferr0ÚimZpaletteZdirtyÚ ImportErrorÚ load_prepareÚsortrZ tile_prefixÚ _getdecoderr!ÚsetimageÚpulls_fdÚsetfdÚdecoder#r)r-rÚLOAD_TRUNCATED_IMAGESÚcleanupr Úload_endr'Z!_close_exclusive_fp_after_loadingr2r)r3ZpixelZuse_mmapr rFrHZ decoder_nameÚextentsÚoffsetÚargsrIr%Zerr_codeÚprefixÚdecoderÚstatusÚbÚsÚeÚnrrrr@šs¢    "       zImageFile.loadcCsR|j s$|jj|jks$|jj|jkr8tjj|j|jƒ|_|jdkrNtjj|ƒdS)NÚP)rKr/r0rr Únewr@)r3rrrrMs$ zImageFile.load_preparecCsdS)Nr)r3rrrrVszImageFile.load_endcCsD||jks0t|dƒo|jdk r8||j|jkr8tdƒ‚|jƒ|kS)NÚ _n_framesz attempt to seek outside sequence)rrCrcZn_framesr,Útell)r3ÚframerrrÚ _seek_check*s  zImageFile._seek_check)NN) Ú__name__Ú __module__Ú __qualname__Ú__doc__rr8r9r@rMrVrfÚ __classcell__rr)r5rrYs/ | 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)ÚNotImplementedError)r3rrrr(AszStubImageFile._opencCsL|jƒ}|dkr"td|j›d�ƒ‚|j|ƒ}|dk s8t‚|j|_|j|_dS)Nzcannot find loader for this z file)Ú_loadr r6r@ÚAssertionErrorr5Ú__dict__)r3ÚloaderÚimagerrrr@Ds  zStubImageFile.loadcCs tdƒ‚dS)z (Hook) Find actual image loader.z+StubImageFile subclass must implement _loadN)rm)r3rrrrnNszStubImageFile._loadN)rgrhrirjr(r@rnrrrrrl9s rlc@sPeZdZdZdZdZdZdZdZdZ dd„Z dd„Z dd „Z d d „Z d d „ZdS)ÚParserzj Incremental image parser. This class implements the standard feed/close consumer interface. NrcCs|jdkstdƒ‚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)Údataro)r3rrrÚreset`sz Parser.resetc CsÊ|jr dS|jdkr||_n |j||_|jrÐ|jdkr|tt|jƒ|jƒ}|j|d…|_|j||_|jdksx|j r|dS|jj|jƒ\}}|dkr¾d|_d|_|dkrºd|_t|ƒndS|j|d…|_nö|jrØnîy&t j |jƒ�}t j |ƒ}WdQRXWnt k �rYn²Xt|dƒ�p*t|dƒ}|�sBt|jƒdk�rJd|_nv|jƒ|jd\}}} } g|_t j|j|| |jƒ|_|jj|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. NrrrGrE)Úfinishedrtr[rXÚminrBrSrrrÚioÚBytesIOrr$r rCrrMrOr/r!rPrK) r3rtÚskipr`r_r%rKÚflagÚdÚoÚarrrÚfeedhsR      z Parser.feedcCs|S)Nr)r3rrrÚ __enter__¸szParser.__enter__cGs |jƒdS)N)r2)r3rYrrrÚ__exit__»szParser.__exit__cCsz|jr*|jdƒd|_|_|js*tdƒ‚|js8tdƒ‚|jrttj|jƒ�$}ztj |ƒ|_Wd|jj ƒXWdQRX|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. r>Nzimage was incompletezcannot parse this image) r[rrtrvr rrrxryrr$r@)r3r%rrrr2¾s   z Parser.close)rgrhrirjZ incrementalrrrtr[rXrvrurr€r�r2rrrrrsSsPrscCs.|jƒt|dƒsf|_|jtd�tt||jddƒ}y|tj kpP|tj j k}Wnt t fk rpd}YnX|r‚|j ƒdSy|jƒ}|j ƒWnât tjfk �rx}z¾x¶|D]®\}}} } tj|j|| |jƒ}| dkrè|j| ƒ|j|j|ƒ|j�r|j|ƒ|jƒ\} } n*x(|j|ƒ\} } } |j| ƒ| �rP�qW| dk�r\t d| ›d�ƒ|‚|jƒq¶WWYdd}~XnžXxš|D]’\}}} } tj|j|| |jƒ}| dk�r´|j| ƒ|j|j|ƒ|j�râ|j|ƒ|jƒ\} } n |j||ƒ} | dk�rt d| ›d�ƒ‚|jƒ�q€Wt|d ƒ�r*|j ƒ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 Ú encoderconfig)r=réFNzencoder error z when writing image fileÚflush)r@rCr‚rNrÚmaxr"r0rDÚstdoutÚbufferr r r„rJrxÚUnsupportedOperationrZ _getencoderr/rHrPrKZ pushes_fdrRZencode_to_pyfdÚencodeÚwriterUZencode_to_file)rKr%rÚbufsizer†ZfhÚexcr_r]r}r~Úlr^r|rrrÚ_saveÞs\               rŽcCsœ|dkr dS|tkr6|j|ƒ}t|ƒ|kr2tdƒ‚|Sg}x8|dkrr|jt|tƒƒ}|sZP|j|ƒ|t|ƒ8}qread method. :param size: Number of bytes to read. :returns: A string containing size bytes of data. Raises an OSError if the file is truncated and the read cannot be completed rr>zTruncated File Readcss|]}t|ƒVqdS)N)rB)Ú.0r|rrrú ;sz_safe_read..)Ú SAFEBLOCKrFrBr rwÚappendÚsumÚjoin)r%r0rtÚblockrrrÚ _safe_read s"     r–c@seZdZdd„Zdd„ZdS)Ú PyCodecStatecCsd|_d|_d|_d|_dS)Nr)ÚxsizeÚysizeÚxoffÚyoff)r3rrrrAszPyCodecState.__init__cCs |j|j|j|j|j|jfS)N)ršr›r˜r™)r3rrrrWGszPyCodecState.extentsN)rgrhrirrWrrrrr—@sr—c@s\eZdZdZdZdd„Zdd„Zedd„ƒZd d „Z d d „Z d d„Z ddd„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` FcGs(d|_tƒ|_d|_||_|j|ƒdS)N)rKr—ÚstateÚfdr/Úinit)r3r/rYrrrrUs zPyDecoder.__init__cCs ||_dS)zš Override to perform decoder specific initialization :param args: Array of args items from the tile entry :returns: None N)rY)r3rYrrrrŸ\szPyDecoder.initcCs|jS)N)Ú _pulls_fd)r3rrrrQeszPyDecoder.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`. N)rm)r3r‡rrrrSis zPyDecoder.decodecCsdS)zV Override to perform decoder specific cleanup :returns: None Nr)r3rrrrUtszPyDecoder.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žrrrrR|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 rzSize cannot be negativerz Tile cannot extend outside imageN)rrrr)rKr0r�r˜r™ršr›Ú ValueError)r3rKrWZx0Zy0Úx1Úy1rrrrP…s    zPyDecoder.setimagecCsd|s |j}tj|jd|ƒ}|j|j|jjƒƒ|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/rrOrPrKr�rWrSr¡)r3rtÚrawmoder|r^rrrÚ set_as_raw¨s    zPyDecoder.set_as_raw)N)N)rgrhrirjr rrŸÚpropertyrQrSrUrRrPr¥rrrrrœKs   #rœiéÿÿÿÿéþÿÿÿr?iøÿÿÿi÷ÿÿÿ)r)rxr-rDrÚrZ_utilrr"r‘rTr rrrrrlrsrŽr–r—rœrrrrÚs2      a B