Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 1øªjÀJã@sŠUdZdZdZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z ddl m Z ddlmZdd lmZmZmZmZmZmZmZmZmZejdd …d`kr¶dd lmZn dd lmZddlmZmZm Z eee!e!e!fee!e!e!fee!e!e!ffZ"e"ee!e!e!e!e!e!fZ#e#eeZ$ee%e$fZ&ee%ee dœdd„Z'e%e%e%dœdd„Z(dae$ee)e*dœdd„Z+e$e*dœdd„Z,e$e-dœdd„Z.e*e-dœdd „Z/e$ddœd!d"„Z0e$ee*e*d#œd$d%„Z1e$e)e*d&œd'd(„Z2e$e*dœd)d*„Z3e"e"e"d+œd,d-„Z4e$ddœd.d/„Z5ee%e)d0œd1d2„ƒZ6ee*e*d0œd3d2„ƒZ6ee)e)d0œd4d2„ƒZ6ee)e%e*fee)e*fd0œd5d2„Z6dbZ7d;j8e7ƒZ9dœd?d@„Z;e%ddAœdBdC„Ze%e%ddIœdJdK„Z?e%e%ddIœdLdM„Z@e%e%ddNœdOdP„ZAe%e%ddNœdQdR„ZBdde%ee%efee%e%fe-ddTœdUdV„ZCe)e%dWœdXdY„ZDGdZd[„d[ƒZEe Gd\d]„d]ƒƒZFejGGd^d_„d_ƒƒZHdS)ez"Utility functions for PDF library.zMathieu Fenniakzbiziqe@mathieu.fenniak.netéN)Ú dataclass)ÚdatetimeÚtimezone)ÚDEFAULT_BUFFER_SIZE)ÚSEEK_CUR) ÚIOÚAnyÚDictÚListÚOptionalÚPatternÚTupleÚUnionÚoverloadééé )Ú TypeAliasé)ÚSTREAM_TRUNCATED_PREMATURELYÚDeprecationErrorÚPdfStreamError)ÚtextÚreturnc Csì|}|dkrdS|djƒr$d|}|jdƒr6|d7}|jddƒjddƒjddƒ}t|jdƒ|jd ƒƒ}|dkrˆ|t|ƒd krˆ|d 7}xPdD]H}ytj||ƒ}Wntk r¸wŽYqŽX|jdƒrÒ|jt j d�}|SqŽWtd|›�ƒ‚dS)NrzD:ÚZÚzZ0000ú+ú'Úú-éZ00úD:%YúD:%Y%múD:%Y%m%dú D:%Y%m%d%Hú D:%Y%m%d%H%MúD:%Y%m%d%H%M%SúD:%Y%m%d%H%M%S%zz+0000)ÚtzinfozCan not convert date: )rr)r!r"r#r$r%r&r') ÚisdigitÚendswithÚreplaceÚmaxÚfindÚlenrÚstrptimeÚ ValueErrorrÚutc)rZorgtextÚiÚfÚd©r5ú-/tmp/pip-build-_d5lkt3n/pypdf/pypdf/_utils.pyÚparse_iso8824_dateLs6   r7)Úheader1Úheader2rcCsfd }g}||kr |j|j|ƒƒ||kr8|j|j|ƒƒt|ƒdkrZtd|›d |›d �ƒ‚|t|ƒS) Nú%PDF-1.3ú%PDF-1.4ú%PDF-1.5ú%PDF-1.6ú%PDF-1.7ú%PDF-2.0rzneither z nor z are proper headers)r:r;r<r=r>r?)ÚappendÚindexr.r0r,)r8r9ÚversionsZpdf_header_indicesr5r5r6Ú_get_max_pdf_version_headerls rC)ÚstreamÚmaxcharsrcCs>d}x4|jdƒ}|jƒs| r P||7}t|ƒ|krPqW|S)a; Read non-whitespace characters and return them. Stops upon encountering whitespace or when maxchars is reached. Args: stream: The data stream from which was read. maxchars: The maximum number of bytes returned; by default unlimited. Returns: The data which was read. ór)ÚreadÚisspacer.)rDrEÚtxtÚtokr5r5r6Úread_until_whitespaces   rK)rDrcCs&|jdƒ}x|tkr |jdƒ}q W|S)z¾ Find and read the next non-whitespace character (ignores whitespace). Args: stream: The data stream from which was read. Returns: The data which was read. r)rGÚ WHITESPACES)rDrJr5r5r6Úread_non_whitespace—s  rMcCs4td}d}x|tkr*|jdƒ}|d7}qW|dkS)a Similar to read_non_whitespace, but return a boolean if more than one whitespace character was read. Args: stream: The data stream from which was read. Returns: True if more than one whitespace was skipped, otherwise return False. rr)rLrG)rDrJZcntr5r5r6Úskip_over_whitespace§s    rN)ÚvaluercCs6x0tt|ƒƒD] }|||d…}|tkrdSqWdS)zØ Check if the given value consists of whitespace characters only. Args: value: The bytes to check. Returns: True if the value only has whitespace characters, otherwise return False. rFT)Úranger.rL)rOrAÚcurrentr5r5r6Úcheck_if_whitespace_onlyºs rRcCs:|jdƒ}|jddƒ|dkr6x|dkr4|jdƒ}q WdS)Nró%ó ó éÿÿÿÿ)rTrU)rGÚseek)rDrJr5r5r6Úskip_over_commentËs    rX)rDÚregexrcCstd}xj|jdƒ}|s|S|j||ƒ}|dk rd|j|jƒt|ƒt|ƒdƒ||d|jƒ…}P||7}qW|S)zé Read until the regular expression pattern matched (ignore the match). Treats EOF on the underlying stream as the end of the token to be matched. Args: regex: re.Pattern Returns: The read bytes. rFéNr)rGÚsearchrWÚstartr.)rDrYÚnamerJÚmr5r5r6Úread_until_regexÓs    r_)rDÚto_readrcCs>|jƒ|krtdƒ‚|j| tƒ|j|ƒ}|j| tƒ|S)a Given a stream at position X, read a block of size to_read ending at position X. This changes the stream's position to the beginning of where the block was read. Args: stream: to_read: Returns: The data which was read. z!Could not read malformed PDF file)ÚtellrrWrrG)rDr`rGr5r5r6Úread_block_backwardsìs   rbcCsøg}d}|jƒdkrttƒ‚xÆtt|jƒƒ}|dkr6Pt||ƒ}t|ƒd}|s~x |dkrp||dkrp|d8}qRW|dkr~d}|r¼|j||dd…ƒx,|dkr¸||dkr¸|d8}qšWn |j|ƒ|dkr|j|dt ƒPqWdj |ddd…ƒS) a Given a byte stream with current position X, return the previous line. All characters between the first CR/LF byte found before X (or, the start of the file, if no such byte is found) and position X After this call, the stream will be positioned one byte after the first non-CRLF character found beyond the first CR/LF byte before X, or, if no such byte is found, at the beginning of the stream. Args: stream: StreamType: Returns: The data which was read. Frrs TNrFrV) rarrÚminrrbr.r@rWrÚjoin)rDZ line_contentZ found_crlfr`ÚblockÚidxr5r5r6Úread_previous_lines0     rg)ÚaÚbrcst‡fdd„|DƒƒS)Nc3s(|] ‰t‡fdd„tˆŽDƒƒVqdS)c3s&|]}tdd„tˆ|ƒDƒƒVqdS)css"|]\}}t|ƒt|ƒVqdS)N)Úfloat)Ú.0r2Újr5r5r6ú Asz6matrix_multiply....N)ÚsumÚzip)rkÚcol)Úrowr5r6rmAsz,matrix_multiply...N)Útuplero)rk)ri)rqr6rmAsz"matrix_multiply..)rr)rhrir5)rir6Úmatrix_multiply=s rsc Csdd}|j| dƒtddƒ�0}|j|j|ƒƒ|jdƒ|j|j|ƒƒWdQRX|j| dƒdS)z5Create text file showing current location in context.iˆrzpypdf_pdfLocation.txtÚwbsHEREN)rWÚopenÚwriterG)rDZradiusZ output_fhr5r5r6Ú mark_locationFs  rw)rircCsdS)Nr5)rir5r5r6Úord_RsrxcCsdS)Nr5)rir5r5r6rxWscCsdS)Nr5)rir5r5r6rx\scCst|tƒrt|ƒS|S)N)Ú isinstanceÚstrÚord)rir5r5r6rxas ó rTrUó órFó[ó])ÚmsgÚ stacklevelrcCstj|t|d�dS)N)r‚)ÚwarningsÚwarnÚDeprecationWarning)r�r‚r5r5r6Ú deprecatelsr†)r�rcCs t|ƒ‚dS)N)r)r�r5r5r6Ú deprecationpsr‡)Úold_nameÚnew_nameÚ removed_inrcCs t|›d|›d|›d�dƒdS)zIRaise an exception that a feature will be removed, but has a replacement.z, is deprecated and will be removed in pypdf z. Use z instead.éN)r†)rˆr‰rŠr5r5r6Údeprecate_with_replacementtsrŒcCst|›d|›d|›d�ƒdS)zMRaise an exception that a feature was already removed, but has a replacement.z( is deprecated and was removed in pypdf z. Use z instead.N)r‡)rˆr‰rŠr5r5r6Údeprecation_with_replacement|sr�)r]rŠrcCst|›d|›d�dƒdS)zFRaise an exception that a feature will be removed without replacement.z, is deprecated and will be removed in pypdf Ú.r‹N)r†)r]rŠr5r5r6Údeprecate_no_replacementƒsr�cCst|›d|›d�ƒdS)zJRaise an exception that a feature was already removed without replacement.z( is deprecated and was removed in pypdf rŽN)r‡)r]rŠr5r5r6Údeprecation_no_replacementˆsr�)r�ÚsrcrcCstj|ƒj|ƒdS)zØ Use this instead of logger.error directly. That allows people to overwrite it more easily. See the docs on when to use which: https://pypdf.readthedocs.io/en/latest/user/suppress-warnings.html N)ÚloggingÚ getLoggerÚerror)r�r‘r5r5r6Ú logger_error�s r•cCstj|ƒj|ƒdS)a‘ Use this instead of logger.warning directly. That allows people to overwrite it more easily. ## Exception, warnings.warn, logger_warning - Exceptions should be used if the user should write code that deals with an error case, e.g. the PDF being completely broken. - warnings.warn should be used if the user needs to fix their code, e.g. DeprecationWarnings - logger_warning should be used if the user needs to know that an issue was handled by pypdf, e.g. a non-compliant PDF being read in a way that pypdf could apply a robustness fix to still read it. This applies mainly to strict=False mode. N)r’r“Úwarning)r�r‘r5r5r6Úlogger_warning™sr—F)Ú func_nameÚkwargsÚaliasesÚfailrc Cs�xŠ|jƒD]~\}}||kr |r2t|›d|›d�ƒ‚||kr`t|›d|›d|›d|›d|›d� ƒ‚|j|ƒ||<tj|›d|›d�td�q Wd S) z¤ Helper function to deprecate arguments. Args: func_name: Name of the function to be deprecated kwargs: aliases: fail: z# is deprecated as an argument. Use z insteadz received both z and z as an argument. z is deprecated. Use z instead.)ÚmessageÚcategoryN)ÚitemsrÚ TypeErrorÚpoprƒr„r…)r˜r™ršr›Zold_termZnew_termr5r5r6Ú rename_kwargs¬s $r¡)ÚbytesrcCsV|d kr|›d�S|d kr*|d d›d�S|d krB|dd›d�S|dd›d �SdS)Nrrz Byteéz.1fz kBé z MBz GBièi@BièiÊš;i@BiÊš;r5)r¢r5r5r6Ú_human_readable_bytesÍs r¥c@s2eZdZdZd dd„Zd edœdd„Zdd „ZdS) Ú classpropertyz‡ Decorator that converts a method with a single cls argument into a property that can be accessed directly from the class. NcCs ||_dS)N)Úfget)ÚselfÚmethodr5r5r6Ú__init__szclassproperty.__init__)rcCs |j|ƒS)N)r§)r¨ÚinstanceÚclsr5r5r6Ú__get__szclassproperty.__get__cCs ||_|S)N)r§)r¨r©r5r5r6Úgetterszclassproperty.getter)N)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__rªrr­r®r5r5r5r6r¦ús r¦c@sReZdZUddlmZdZedZedZ e e edœdd„Z edœd d „Z dS) ÚFiler)ÚIndirectObjectrrFN)rcCs&|jj›d|j›dtt|jƒƒ›d�S)Nz(name=z, data: ú))Ú __class__r¯r]r¥r.Údata)r¨r5r5r6Ú__str__sz File.__str__cCs"|jƒdd…dt|jƒ›d�S)Nrz, hash: rµrV)r¸Úhashr·)r¨r5r5r6Ú__repr__sz File.__repr__) r¯r°r±Zgenericr´r]rzr·r¢Zindirect_referencer r¸rºr5r5r5r6r³ s   r³c@sbeZdZejdƒZeddœdd„Zeee e efdœdd„Z e e dœd d „Zee dœd d „ZdS) ÚVersionz ^(\d+)(.*)$N)Ú version_strrcCs||_|j|ƒ|_dS)N)r¼Ú_parse_versionÚ components)r¨r¼r5r5r6rª'szVersion.__init__cCsr|jdƒ}g}x^|D]V}tjj|ƒ}|s8|jd|fƒq|jdƒ}|jdƒ}|dkrXd}|jt|ƒ|fƒqW|S)NrŽrrr)Úsplitr»ÚCOMPONENT_PATTERNÚmatchr@ÚgroupÚint)r¨r¼r¾Zparsed_componentsÚ componentrÁZinteger_prefixÚsuffixr5r5r6r½+s     zVersion._parse_version)ÚotherrcCst|tƒsdS|j|jkS)NF)ryr»r¾)r¨rÆr5r5r6Ú__eq__:s zVersion.__eq__cCs¤t|tƒstdt|ƒ›�ƒ‚tt|jƒt|jƒƒ}x\t|ƒD]P}|j|\}}|j|\}}||krhdS||krtdS||kr€dS||krsv   ,  .  : "   -