*ec@s3dZddlmZmZmZmZejZejZej Z ej Z dZ dejfdYZ yddlZWnek rdZnXidd6dd6d d 6Zd Zd Zddd ZddZeje je e eje jeeje jdeje jddS(s0.9i(tImaget ImageFilet ImagePalettet_binarycCs|d dkS(NitGIF87atGIF89a(RR((tprefix((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pyt_accept.st GifImageFilecBs>eZdZdZdZdZdZdZdZ RS(tGIFsCompuserve GIFcCs>|jjd}|r:t|r:|jjt|SdS(Ni(tfptreadti8tNone(tselfts((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pytdata<scCs|jjd}|d dkr1tdn|d |jd}xtdt |dD]}}|dt||ko.t||d ko.t||dknst j d|}||_ |_ PqqWn|j|_|jj|_|jddS(Ni iRRsnot a GIF filetversionii iiii t backgroundiiitRGB(sGIF87asGIF89a(R R t SyntaxErrortinfoti16tsizettileR trangetlenRtrawtglobal_palettetpalettet_GifImageFile__fpttellt_GifImageFile__rewindtseek(RRtflagstbitstpti((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pyt_openBs&#  Q  c Cs'|dkr=d|_d|_d|_|jj|jn||jdkrctd|n||_g|_|j|_ |jr|j j|jx|j rqWd|_n|jr|j|_ d|_n|j |_ xtr|j jd}| s|dkrPq|dkr|j jd}|j }t|dkrt|d}|d@rt|d|jd |_ nt|j jd} |j j|_d||||f|j| | ffg|_PqqW|jstdnd |_|j r#d |_ndS(!Niiiscannot seek to frame %dt;t!iit transparencyi tdurationitPRiit extensioni s NETSCAPE2.0tloopt,i iiii@iiRtgifsno more images in GIF filetL( t_GifImageFile__offsetR tdisposet_GifImageFile__frameRR!R t ValueErrorRR RtimRRtTrueR R RRRtcoretfillRtcopytAttributeErrortKeyErrorRRRRtEOFErrortmode( RtframeRtblockR"tx0ty0tx1ty1t interlaceR#((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pyR!bs                    (# !) (   cCs|jS(N(R3(R((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pyRsN( t__name__t __module__tformattformat_descriptionR RRR&R!R(((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pyR5s  oNR0t1R+c Cstr8ytj|||dSWq8tk r4q8Xnyt|j}|}WnVtk rtj|jdkr|jd}d}q|jd}d}nXy|j d}Wntk rd}nXx*t |||j D]}|j |qWd}y|j d}Wntk r0d}nXt |jdkrOd}n|rb|d B}ny|j d } Wntk rnPX|j d td td tdtdtt| td|j dtdtdt|jdt|jdt|tdd|f|_tj||dd|jd|fg|j d|j dy|jWnnXdS(NRR+R0RiRDiii@R)R(iiR.iR/tR'(ii(t _imaging_giftsavetIOErrortRAWMODER=R;Rt getmodebasetconvertt encoderinfoR t getheadertwritetminRto8to16tintt encoderconfigRt_savetflush( R5R tfilenametrawmodetimOutRRR"RDR)((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pyRYs^             IC)  cCswddl}|j}|jdkrA|jd||fn|jd||fy|j|WnnXdS(NiRsppmtogif %s >%ssppmquant 256 %s | ppmtogif >%s(tost_dumpR=tsystemtunlink(R5R R[R^tfile((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pyt _save_netpbm3s  c Cs;|o|jdd}dt|jdt|jdtd tdtdg}|rd}d}x6|jD]}|r|}n|d}qWnd}|jdkr |d k rt|tr|}n|j j d |d  }|j |n.x+t |D]}|j t|d qW|S( s2Return a list of strings representing a GIF headertoptimizeiRiiiiR+RiiN( tgetRVRRUt histogramR=R t isinstancetbytesR5t getpalettetappendR( R5RRRdRR%tmaxcolortcountt paletteBytes((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pyRRGs&9  icKsdd dY}|j|}z||_|jdt|dt|dt|jdt|jdtdtdtj||dd |jdt|j fg|jdWd |`X|j S( sReturn a list of strings representing this image. The first string is a local image header, the rest contains encoded image data.t collectorcBseZgZdZRS(cSs|jj|dS(N(RRj(RR((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pyRSxs(RERFRRS(((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pyRnvsR.iiiR/RJN((ii( tloadRQRSRVRRURRYRNR=R(R5toffsettparamsRnR ((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pytgetdataqs   K0s.gifs image/gif(ii(t __version__tPILRRRRR ti16leRRUto16leRVRRRKt ImportErrorR RNRYRcRRRrt register_openRGt register_savetregister_extensiont register_mime(((s8/usr/lib64/python2.7/site-packages/PIL/GifImagePlugin.pyts."         P * '