Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/PIL/__pycache__/ImageFile.cpython-37.pyc

178 lines
14 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
(U<>]Q<00>@s<>ddlZddlZddlZddlmZddlmZdZdZdZ dd d
d d d <0A>Z
dd<0F>Z dd<11>Z Gdd<13>dej<04>Z Gdd<15>de <0A>ZGdd<17>de<0F>Zd dd<19>Zdd<1B>ZGdd<1D>de<0F>ZGdd<1F>de<0F>ZdS)!<21>N<>)<01>Image)<01>isPathiiFzimage buffer overrun errorzdecoding errorz unknown errorzbad configurationzout of memory error)<05><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>i<EFBFBD><69><EFBFBD><EFBFBD>i<EFBFBD><69><EFBFBD><EFBFBD>cCsLytj<01>|<00>}Wntk
r.t<04>|<00>}YnX|s<d|}t|d<00><01>dS)Nzdecoder error %dz when reading image file)r<00>coreZgetcodecstatus<75>AttributeError<6F>ERRORS<52>get<65>IOError)<02>error<6F>message<67>r<00>1/tmp/pip-install-pc7tm5jb/Pillow/PIL/ImageFile.py<70> raise_ioerror4srcCs|dS)N<>r)<01>trrr<00> _tilesortCsrc@sReZdZdZddd<04>Zdd<06>Zdd<08>Zd d
<EFBFBD>Zd d <0C>Zd d<0E>Z dd<10>Z
dd<12>Z dS)<14> ImageFilez*Base class for image file format handlers.Nc Cs<>tj<00>|<00>d|_d|_d|_d|_d|_t|_t |<01>rRt
|d<04>|_ ||_ d|_ n||_ ||_ d|_ y |<00><0E>WnFtttttjfk
r<EFBFBD>}z|j r<>|j <0B><15>t|<03><01>Wdd}~XYnX|jr<>|jddkr<>td<06><01>dS)Nrrr<00>rbTznot identified by this driver)r<00>__init__<5F>
_min_frame<EFBFBD>custom_mimetype<70>tile<6C>readonly<6C> decoderconfig<69>MAXBLOCK<43>decodermaxblockr<00>open<65>fp<66>filename<6D> _exclusive_fp<66>_open<65>
IndexError<EFBFBD> TypeError<6F>KeyError<6F>EOFError<6F>structr <00>close<73> SyntaxError<6F>mode<64>size)<04>selfr r!<00>vrrrrPs6   
zImageFile.__init__cCsdS)zSet draft modeNr)r-r+r,rrr<00>draftzszImageFile.draftcCs,|jr |jS|jdk r(tj<03>|j<01><05><00>SdS)N)r<00>formatrZMIMEr <00>upper)r-rrr<00>get_format_mimetypes
zImageFile.get_format_mimetypecCs|jr|j<01><02>d|_dS)zCheck file integrityN)r"r r))r-rrr<00>verify<66>s
zImageFile.verifyc
Cs<>tj<00>|<00>}|jdkrtd<02><01>|js(|Sd|_|jo@t|j<02>dk}|oPttd<04> }d}y|j }d}Wnt
k
r<EFBFBD>|j j }YnXy|j }d}Wnt
k
r<EFBFBD>|j j}YnX|<02>r<>|jd\}}}} |dk<02>r<>t| <09>dk<05>r<>| d|jk<02>r<>| dtjk<06>r<>y<EFBFBD>ttjd <09><02>rLtj<11>|j<05>|_|j<04>|<08>|j<04>|j|j| d| d
<00>|_nTddl}
t|jd <0B><02>} |
j| <0B><17>d|
jd <0C>|_WdQRXtj<11>|j|j|||| <09>|_d}|j<1A>r<>d|j_Wn"t
ttfk
<EFBFBD>r<>d|_YnX|<00><1E>d } |j<04>s6|jjt d<0E>y
|j!} Wnt
k
<EFBFBD>r d} YnX<00>x|jD<00>]\}}}} t<00>"|j|| |j#<23>}z<>||<08>|<0E>$|j|<07>|j%<25>r<>|<0E>&|j <0B>|<0E>'d<0F>\}} n<>| }x<>y||j(<28>}Wn.t)t*j+fk
<EFBFBD>r<>t,<2C>r<>Pntd<10><01>YnX|<11>s<>t,<2C>r<>Pntdt|<10><00><01>||}|<0E>'|<10>\}} |dk<00>rP||d<01>}<10>q<>WWd|<0E>-<2D>X<00>q,Wg|_||_.|<00>/<2F>|j0<6A>rd|j1<6A>rd|j <0B>2<EFBFBD>d|_ |j<04>s<>t,<2C>s<>| dk<00>r<>t3| <0C>tj<00>|<00>S)z"Load image data based on tile listNzcannot load this imager<00>pypy_version_inforF<>raw<61><00>mapr<00>r)<01>accessr)<01>key<65>zimage file is truncatedz0image file is truncated (%d bytes not processed))4r<00>loadrr r7r!<00>len<65>hasattr<74>sys<79> load_readr r <00>read<61> load_seek<65>seekr+Z _MAPMODESrZ readimager,<00>im<69>mmapr<00>filenoZ ACCESS_READZ
map_bufferZpaletteZdirty<74>EnvironmentError<6F> ImportError<6F> load_prepare<72>sortrZ tile_prefix<69> _getdecoderr<00>setimage<67>pulls_fd<66>setfd<66>decoderr$r(r <00>LOAD_TRUNCATED_IMAGES<45>cleanupr<00>load_endr"Z!_close_exclusive_fp_after_loadingr)r)r-ZpixelZuse_mmaprrArCZ decoder_name<6D>extents<74>offset<65>argsrEr Zerr_code<64>prefix<69>decoder<65>status<75>b<>s<>nrrrr<<00>s<> 

   

  

zImageFile.loadcCsP|jr"|jj|jks"|jj|jkr6tj<04>|j|j<02>|_|jdkrLtj<03>|<00>dS)N<>P)rDr+r,rr<00>newr<)r-rrrrIs"
zImageFile.load_preparecCsdS)Nr)r-rrrrRszImageFile.load_endcCsB||jks.t|d<01>r|jdks6||j|jkr6td<02><01>|<00><05>|kS)N<> _n_framesz attempt to seek outside sequence)rr>r^Zn_framesr'<00>tell)r-<00>framerrr<00> _seek_check(s

zImageFile._seek_check)NN) <0C>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rr/r2r3r<rIrRrarrrrrMs
*  rc@s(eZdZdZdd<03>Zdd<05>Zdd<07>ZdS) <09> StubImageFilez<65>
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<01><01>dS)Nz+StubImageFile subclass must implement _open)<01>NotImplementedError)r-rrrr#?szStubImageFile._opencCsH|<00><00>}|dkrtd|j<00><01>|<01>|<00>}|dk s4t<04>|j|_|j|_dS)Nz#cannot find loader for this %s file)<07>_loadr r0r<<00>AssertionError<6F> __class__<5F>__dict__)r-<00>loader<65>imagerrrr<Bs
 zStubImageFile.loadcCs td<01><01>dS)z (Hook) Find actual image loader.z+StubImageFile subclass must implement _loadN)rg)r-rrrrhLszStubImageFile._loadN)rbrcrdrer#r<rhrrrrrf7s
rfc@sPeZdZdZdZdZdZdZdZdZ dd<05>Z
dd<07>Z dd <09>Z d
d <0B>Z d d <0A>ZdS)<0E>Parserzj
Incremental image parser. This class implements the standard
feed/close consumer interface.
NrcCs|jdkstd<02><01>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)<02>datari)r-rrr<00>reset^sz Parser.resetc Cs<>|jr
dS|jdkr||_n |j||_|jr<>|jdkrztt|j<01>|j<03>}|j|d<01>|_|j||_|jdksv|jszdS|j<02>|j<01>\}}|dkr<>d|_d|_|dkr<>d|_t|<04>ndS|j|d<01>|_n<>|jr<>n<EFBFBD>y&t <09>
|j<01><01>}t <0B> |<05>}WdQRXWnt k
<EFBFBD>rYn<>Xt|d<04><02>p(t|d<05>}|<07>s@t|j<0F>dk<03>rHd|_nv|<06><10>|jd\}}} }
g|_t <0B>|j||
|j<13>|_|j<02>|j|<04>| |_|jt|j<01>k<01>r<>|j|jd<01>|_d|_||_dS)z<>
(Consumer) Feed data to the parser.
:param data: A string buffer.
:exception IOError: If the parser failed to parse the image file.
NrrrBr@)<16>finishedrorWrT<00>minr=rOrmr<00>io<69>BytesIOrrr r>rrIrKr+rrLrD) r-ro<00>skipr[<00>er rD<00>flag<61>d<>o<>arrr<00>feedfsR 
 
 
z Parser.feedcCs|S)Nr)r-rrr<00> __enter__<5F>szParser.__enter__cGs |<00><00>dS)N)r))r-rUrrr<00>__exit__<5F>szParser.__exit__c Csz|jr*|<00>d<01>d|_|_|js*td<03><01>|js8td<04><01>|jrtt<06>|j<02><01>$}zt<08> |<01>|_Wd|j<05>
<EFBFBD>XWdQRX|jS)a
(Consumer) Close the stream.
:returns: An image object.
:exception IOError: 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) rWr{rorqr rmrsrtrrr<)r-r rrrr)<00>s

 z Parser.close)rbrcrdre<00> incrementalrmrorWrTrqrpr{r|r}r)rrrrrnQsPrnc
Cs<>|<00><00>t|d<01>sd|_|jtd<03>tt||jdd<00>}|tj krP|<01>
<EFBFBD>dSy|<01> <0B>}|<01>
<EFBFBD>Wn<>t t jfk
<EFBFBD>r,x<>|D]<5D>\}}}}t<0F>|j|||j<02>}|dkr<>|<01>|<07>|<05>|j|<06>|jr<>|<05>|<01>|<05><17>\} }
n&x$|<05>|<03>\} }
} |<01>| <0B>|
r<EFBFBD>Pq<>W|
dk<00>rtd|
<00><01>|<05><1B>q<>WYn<>Xx<>|D]<5D>\}}}}t<0F>|j|||j<02>}|dk<04>rh|<01>|<07>|<05>|j|<06>|j<15>r<>|<05>|<01>|<05><17>\} }
n |<05>||<03>}
|
dk<00>r<>td|
<00><01>|<05><1B><00>q4Wt|d<08><02>r<>|<01>
<EFBFBD>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
<20> encoderconfigr)r:r<00>Nz(encoder error %d when writing image file<6C>flush)r<r>rrJr<00>maxrr,r?<00>stdoutr<74>rFr rs<00>UnsupportedOperationrZ _getencoderr+rCrLrDZ pushes_fdrNZencode_to_pyfd<66>encode<64>writer rQZencode_to_file) rDr r<00>bufsize<7A>fhrvrYryrz<00>lrZrxrrr<00>_save<76>sT 
 
 



 


 
  r<>cCsf|dkr dS|tkr|<00>|<01>Sg}x8|dkrZ|<00>t|t<00><02>}|sBP|<02>|<03>|t|<03>8}q$Wd<02>|<02>S)ao
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 up to <i>size</i> bytes of data.
rr;)<06> SAFEBLOCKrArr<00>appendr=<00>join)r r,ro<00>blockrrr<00>
_safe_reads



r<>c@seZdZdd<02>Zdd<04>ZdS)<06> PyCodecStatecCsd|_d|_d|_d|_dS)Nr)<04>xsize<7A>ysize<7A>xoff<66>yoff)r-rrrr3szPyCodecState.__init__cCs |j|j|j|j|j|jfS)N)r<>r<>r<>r<>)r-rrrrS9szPyCodecState.extentsN)rbrcrdrrSrrrrr<>2sr<>c@s\eZdZdZdZdd<04>Zdd<06>Zedd<08><00>Zd d
<EFBFBD>Z d d <0C>Z
d d<0E>Z ddd<11>Z ddd<13>Z dS)<16> PyDecoderz<72>
Python implementation of a format decoder. Override this class and
add the decoding logic in the `decode` method.
See :ref:`Writing Your Own File Decoder in Python<file-decoders-py>`
FcGs(d|_t<01>|_d|_||_|<00>|<02>dS)N)rDr<><00>state<74>fdr+<00>init)r-r+rUrrrrGs
zPyDecoder.__init__cCs
||_dS)z<>
Override to perform decoder specific initialization
:param args: Array of args items from the tile entry
:returns: None
N)rU)r-rUrrrr<>NszPyDecoder.initcCs|jS)N)<01> _pulls_fd)r-rrrrMWszPyDecoder.pulls_fdcCs
t<00><00>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 `ERRORS`
N)rg)r-<00>bufferrrrrO[s zPyDecoder.decodecCsdS)zV
Override to perform decoder specific cleanup
:returns: None
Nr)r-rrrrQfszPyDecoder.cleanupcCs
||_dS)z<>
Called from ImageFile to set the python file-like object
:param fd: A python file-like object
:returns: None
N)r<>)r-r<>rrrrNnszPyDecoder.setfdNcCs<>||_|r|\}}}}n d\}}}}|dkrJ|dkrJ|jj\|j_|j_n(||j_||j_|||j_|||j_|jjdks<>|jjdkr<>td<03><01>|jj|jj|jjdks<>|jj|jj|jjdkr<>td<05><01>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)rDr,r<>r<>r<>r<>r<><00>
ValueError)r-rDrSZx0Zy0<79>x1<78>y1rrrrLws    zPyDecoder.setimagecCsd|s
|j}t<01>|jd|<02>}|<03>|j|j<05><06><00>|<03>|<01>}|ddkrLtd<03><01>|ddkr`td<05><01>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
r5rznot enough image datarzcannot decode image dataN) r+rrKrLrDr<>rSrOr<>)r-ro<00>rawmoderxrZrrr<00>
set_as_raw<EFBFBD>s

  zPyDecoder.set_as_raw)N)N)rbrcrdrer<>rr<><00>propertyrMrOrQrNrLr<>rrrrr<>=s  
#r<>)r)rsr(r?<00>rZ_utilrrr<>rPr
rrrrf<00>objectrnr<>r<>r<>r<>rrrr<00><module>s.  
k
>