³ò :]Dc @s(dZddkZddkZddkZd„Zd„Zd„Zdeifd„ƒYZyddkZWne j o dZnXhdd <dd<d d S(Niii(tord(tc((sGifImagePlugin.pycti16%scCs t|d@ƒt|d?d@ƒS(Niÿi(tchr(ti((sGifImagePlugin.pycto16(scCs|d djS(NitGIF87atGIF89a(sGIF87asGIF89a((tprefix((sGifImagePlugin.pyct_accept/st GifImageFilecBs>eZdZdZdZd„Zd„Zd„Zd„Z RS(tGIFsCompuserve GIFcCsD|iidƒ}|o't|ƒo|iit|ƒƒSndS(Ni(tfptreadRtNone(tselfts((sGifImagePlugin.pyctdata=sc Csˆ|iidƒ}|d djo td‚n|d |idƒ}x“tdt |ƒdƒD]u}t |dƒ||jo&||d jo||djnp't i d|ƒ}||_ |_PqÜqÜWn|i|_|iiƒ|_|idƒdS(Ni iRRsnot a GIF filetversionii iii€i t backgroundiiitRGB(sGIF87asGIF89a(R R t SyntaxErrortinfoRtsizettileRtrangetlenRt ImagePalettetrawtglobal_palettetpalettet_GifImageFile__fpttellt_GifImageFile__rewindtseek(RRtflagstbitstpR((sGifImagePlugin.pyct_openCs( #  H  c Csý|djo2d|_d|_d|_|ii|iƒn||idjotd|‚n||_g|_|i|_ |io5|i i|iƒx|i ƒoq¢Wd|_n|io|i|_ d|_n|i |_ xÏ|i idƒ}| p |djoPqó|djol|i idƒ}|i ƒ}t|ƒdjoÍt|dƒ}|d@ot|dƒ|id ƒƒ|_ nt|i idƒƒ} |i iƒ|_d||||f|i| | ffg|_Pqóqó|ip td‚nd |_|i o d |_ndS(!Niiÿÿÿÿiscannot seek to frame %dt;t!iùit transparencyi tdurationitPRiiÿt extensioni s NETSCAPE2.0tloopt,i iiii@i€iRtgifsno more images in GIF filetL(t_GifImageFile__offsetRtdisposet_GifImageFile__frameRR"R!t ValueErrorRR RtimRRR RRRtImagetcoretfillRtcopytAttributeErrortKeyErrorR RRtEOFErrortmode( RtframeRtblockR#tx0ty0tx1ty1t interlaceR$((sGifImagePlugin.pycR"csŠ                       !) )    cCs|iS(N(R3(R((sGifImagePlugin.pycR ÐsN( t__name__t __module__tformattformat_descriptionRRRR&R"R (((sGifImagePlugin.pycR 6s  mR0t1R+c Cs}to5yti|||ƒdSWq<tj oq<Xnyt|i}|}WnZtj oNti|iƒdjo|idƒ}d}q°|idƒ}d}nXx't ||i ƒD]}|i |ƒqÃWd}y|i d}Wntj o d}nXt |i ƒdjo d}n|o|dB}ny|i d }Wntj onQX|i d td ƒtd ƒtdƒtdƒtt|ƒƒtdƒƒ|i d tdƒtdƒt|i dƒt|i dƒt|ƒtdƒƒd|f|_ti||dd|i d|fgƒ|i dƒ|i dƒy|iƒWnnXdS(NRR+R0iRDiii@R)R(iùiR.iR/tR'(ii(t _imaging_giftsavetIOErrortRAWMODER=R;R6t getmodebasetconvertt getheadert encoderinfotwritetminRRRtintt encoderconfigt ImageFilet_savetflush( R5R tfilenametrawmodetimOutRR#RDR)((sGifImagePlugin.pycRXâsX       IC)  cCsyddk}|iƒ}|idjo|id||fƒn|id||fƒy|i|ƒWnnXdS(NiÿÿÿÿRsppmtogif %s >%ssppmquant 256 %s | ppmtogif >%s(tost_dumpR=tsystemtunlink(R5R RZR]tfile((sGifImagePlugin.pyct _save_netpbm-s  cCs|o|iddƒ}dt|idƒt|idƒtd ƒtdƒtdƒg}|oBd}d}x9|iƒD]!}|o |}n|d}q‚Wnd}|idjo%|i|iid ƒ|d  ƒn/x+t |ƒD]}|it|ƒd ƒqóW|S( s2Return a list of strings representing a GIF headertoptimizeiRiii€iR+Rii‡( tgetRRRt histogramR=tappendR5t getpaletteR(R5RRcRRtmaxcolortcount((sGifImagePlugin.pycRQAs$9  % ic Ksàdd d„ƒY}|iƒ|ƒ}z©||_|idt|dƒt|dƒt|idƒt|idƒtdƒtdƒƒti||dd |idt|i fgƒ|idƒWd |`X|i S( sReturn a list of strings representing this image. The first string is a local image header, the rest contains encoded image data.t collectorcBseZgZd„ZRS(cSs|ii|ƒdS(N(RRf(RR((sGifImagePlugin.pycRSls(RERFRRS(((sGifImagePlugin.pycRjjsR.iiiR/RJN((ii( tloadRRRSRRRRWRXRNR=R(R5toffsettparamsRjR ((sGifImagePlugin.pyctgetdataes   K0s.gifs image/gif(ii(t __version__R6RWRRRR R RKt ImportErrorRRNRXRbRQRnt register_openRGt register_savetregister_extensiont register_mime(((sGifImagePlugin.pycss*$   ¡     K  $ '