+
    ^eòj<  ã                   ó$  € R t ^ RIt^ RIHtHt ^ RIHtHt ^ RIH	t	 ^ RI
Ht  ! R R]	4      t ! R R	]4      t ! R
 R]4      t ! R R4      t ! R R4      t ! R R4      tR t ! R R4      t ! R R]4      t ! R R]4      t ! R R]4      tR# )zdObjects related to parsing headers of JPEG image streams.

Includes both JFIF and Exif sub-formats.
N)ÚJPEG_MARKER_CODEÚ	MIME_TYPE)Ú
BIG_ENDIANÚStreamReader)ÚBaseImageHeader)ÚTiffc                   óD   a € ] tR t^t o Rt]R 4       t]R 4       tRtV t	R# )ÚJpegz(Base class for JFIF and EXIF subclasses.c                ó"   € \         P                  # )zOMIME content type for this image, unconditionally `image/jpeg` for JPEG
images.)r   ÚJPEG©Úselfs   &Ú†/opt/data/installs/351f81cc06284494/environments/aa258815729c481f8402f54f4c368f83/venv/lib/python3.14/site-packages/docx/image/jpeg.pyÚcontent_typeÚJpeg.content_type   s   € ô �~‰~Ðó    c                ó   € R# )z8Default filename extension, always 'jpg' for JPG images.Újpg© r   s   &r   Údefault_extÚJpeg.default_ext   s   € ñ r   r   N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úpropertyr   r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r	   r	      s.   ø‡ € Ù2àñó ðð
 ñó ör   r	   c                   ó4   a € ] tR t^t o Rt]R 4       tRtV tR# )ÚExifz*Image header parser for Exif image format.c                óî   € \         P                  V4      pVP                  P                  pVP                  P                  pVP
                  P                  pVP
                  P                  pV ! W4WV4      # )zSReturn |Exif| instance having header properties parsed from Exif image in
`stream`.)Ú_JfifMarkersÚfrom_streamÚsofÚpx_widthÚ	px_heightÚapp1Úhorz_dpiÚvert_dpi©ÚclsÚstreamÚmarkersr'   r(   r*   r+   s   &&     r   r%   ÚExif.from_stream    s_   € ô ×*Ñ*¨6Ó2ˆð —;‘;×'Ñ'ˆØ—K‘K×)Ñ)ˆ	Ø—<‘<×(Ñ(ˆØ—<‘<×(Ñ(ˆá�8¨Ó;Ð;r   r   N©	r   r   r   r   r   Úclassmethodr%   r   r   r   s   @r   r"   r"      s   ø‡ € Ù4àñ<ó ö<r   r"   c                   ó4   a € ] tR t^/t o Rt]R 4       tRtV tR# )ÚJfifz*Image header parser for JFIF image format.c                óî   € \         P                  V4      pVP                  P                  pVP                  P                  pVP
                  P                  pVP
                  P                  pV ! W4WV4      # )zPReturn a |Jfif| instance having header properties parsed from image in
`stream`.)r$   r%   r&   r'   r(   Úapp0r*   r+   r,   s   &&     r   r%   ÚJfif.from_stream2   s]   € ô ×*Ñ*¨6Ó2ˆà—;‘;×'Ñ'ˆØ—K‘K×)Ñ)ˆ	Ø—<‘<×(Ñ(ˆØ—<‘<×(Ñ(ˆá�8¨Ó;Ð;r   r   Nr1   r   s   @r   r4   r4   /   s   ø‡ € Ù4àñ
<ó ö
<r   r4   c                   ó|   a a€ ] tR t^@t oRtV 3R ltR t]R 4       t]	R 4       t
]	R 4       t]	R 4       tRtVtV ;t# )	r$   zbSequence of markers in a JPEG file, perhaps truncated at first SOS marker for
performance reasons.c                óL   <€ \         \        V `  4        \        V4      V n        R # ©N)Úsuperr$   Ú__init__ÚlistÚ_markers)r   r/   Ú	__class__s   &&€r   r<   Ú_JfifMarkers.__init__D   s   ø€ ÜŒl˜DÑ*Ô,Ü˜W›ˆŽr   c           	     ó  € RpRp. pV P                    FP  pVP                  VVP                  VP                  \	        VP
                  4      VP                  3,          4       KR  	  V.V,           pRP                  V4      # )zsReturns a tabular listing of the markers in this instance, which can be handy
for debugging and perhaps other uses.z4 offset  seglen  mc  name
=======  ======  ==  =====z%7d  %6d  %02X  %sÚ
)r>   ÚappendÚoffsetÚsegment_lengthÚordÚmarker_codeÚnameÚjoin)r   ÚheaderÚtmplÚrowsÚmarkerÚliness   &     r   Ú__str__Ú_JfifMarkers.__str__H   s|   € ð IˆØ#ˆØˆØ—m”mˆFØ�K‰KØà—M‘MØ×)Ñ)Ü˜×*Ñ*Ó+Ø—K‘Kð	õöñ $ð �˜4•ˆØ�y‰y˜ÓÐr   c                óÒ   € \         P                  V4      p. pVP                  4        F5  pVP                  V4       VP                  \
        P                  8X  g   K5   M	  V ! V4      # )zjReturn a |_JfifMarkers| instance containing a |_JfifMarker| subclass instance
for each marker in `stream`.)Ú_MarkerParserr%   Úiter_markersrC   rG   r   ÚSOS)r-   r.   Úmarker_parserr/   rM   s   &&   r   r%   Ú_JfifMarkers.from_stream[   s\   € ô &×1Ñ1°&Ó9ˆØˆØ#×0Ñ0Ö2ˆFØ�N‰N˜6Ô"Ø×!Ñ!Ô%5×%9Ñ%9Ö9Ùñ 3ñ �7‹|Ðr   c                ó„   € V P                    F&  pVP                  \        P                  8X  g   K$  Vu # 	  \	        R4      h)z#First APP0 marker in image markers.zno APP0 marker in image)r>   rG   r   ÚAPP0ÚKeyError©r   Úms   & r   r6   Ú_JfifMarkers.app0g   ó8   € ð —”ˆAØ�}‰}Ô 0× 5Ñ 5Ö5Ø’ñ ô Ð0Ó1Ð1r   c                ó„   € V P                    F&  pVP                  \        P                  8X  g   K$  Vu # 	  \	        R4      h)z#First APP1 marker in image markers.zno APP1 marker in image)r>   rG   r   ÚAPP1rY   rZ   s   & r   r)   Ú_JfifMarkers.app1o   r]   r   c                ó„   € V P                    F&  pVP                  \        P                  9   g   K$  Vu # 	  \	        R4      h)z4First start of frame (SOFn) marker in this sequence.z(no start of frame (SOFn) marker in image)r>   rG   r   ÚSOF_MARKER_CODESrY   rZ   s   & r   r&   Ú_JfifMarkers.sofw   s8   € ð —”ˆAØ�}‰}Ô 0× AÑ AÖAØ’ñ ô ÐAÓBÐBr   )r>   )r   r   r   r   r   r<   rO   r2   r%   r   r6   r)   r&   r   r   Ú__classcell__©r?   r    s   @@r   r$   r$   @   sl   ù‡ € ñõ&ò ð& ñ	ó ð	ð ñ2ó ð2ð ñ2ó ð2ð ñCó ÷Cð Cr   r$   c                   óL   a a€ ] tR t^€t oRtV 3R lt]R 4       tR tRt	Vt
V ;t# )rR   zQService class that knows how to parse a JFIF stream and iterate over its
markers.c                ó8   <€ \         \        V `  4        Wn        R # r:   )r;   rR   r<   Ú_stream)r   Ústream_readerr?   s   &&€r   r<   Ú_MarkerParser.__init__„   s   ø€ ÜŒm˜TÑ+Ô-Ø$Žr   c                ó2   € \        V\        4      pV ! V4      # )zFReturn a |_MarkerParser| instance to parse JFIF markers from `stream`.)r   r   )r-   r.   ri   s   && r   r%   Ú_MarkerParser.from_streamˆ   s   € ô % V¬ZÓ8ˆÙ�=Ó!Ð!r   c              #  ó   "  € \         P                  V P                  4      p^ pRpV\        P                  8w  dB   VP                  V4      w  r4\        W0P                  V4      pVx € WEP                  ,           pKV  R# 5i)z}Generate a (marker_code, segment_offset) 2-tuple for each marker in the JPEG
`stream`, in the order they occur in the stream.N)Ú_MarkerFinderr%   rh   r   ÚEOIÚnextÚ_MarkerFactoryrE   )r   Úmarker_finderÚstartrG   Úsegment_offsetrM   s   &     r   rS   Ú_MarkerParser.iter_markersŽ   so   é € ô &×1Ñ1°$·,±,Ó?ˆØˆØˆØÔ-×1Ñ1Ô1Ø*7×*<Ñ*<¸UÓ*CÑ'ˆKÜ# K·±¸~ÓNˆFØŠLØ"×%:Ñ%:Õ:ŠEñ	 2ùs   ‚A<A>©rh   )r   r   r   r   r   r<   r2   r%   rS   r   r   rd   re   s   @@r   rR   rR   €   s-   ù‡ € ñõ%ð ñ"ó ð"÷

;ò 
;r   rR   c                   ó^   a a€ ] tR t^›t oRtV 3R lt]R 4       tR tR t	R t
R tRtVtV ;t# )	rn   zFService class that knows how to find the next JFIF marker in a stream.c                ó8   <€ \         \        V `  4        Wn        R # r:   )r;   rn   r<   rh   )r   r.   r?   s   &&€r   r<   Ú_MarkerFinder.__init__ž   s   ø€ ÜŒm˜TÑ+Ô-ØŽr   c                ó   € V ! V4      # )zCReturn a |_MarkerFinder| instance to find JFIF markers in `stream`.r   )r-   r.   s   &&r   r%   Ú_MarkerFinder.from_stream¢   s   € ñ �6‹{Ðr   c                óŽ   € Tp V P                  VR7      pV P                  V^,           R7      w  r#VR8X  d   K7  Y2^,           rT WE3# )a0  Return a (marker_code, segment_offset) 2-tuple identifying and locating the
first marker in `stream` occuring after offset `start`.

The returned `segment_offset` points to the position immediately following the
2-byte marker code, the start of the marker segment, for those markers that have
a segment.
)rs   ó    )Ú_offset_of_next_ff_byteÚ_next_non_ff_byte)r   rs   ÚpositionÚbyte_rG   rt   s   &&    r   rp   Ú_MarkerFinder.next§   sX   € ð ˆØà×3Ñ3¸(Ð3ÓCˆHà"×4Ñ4¸8Àa½<Ð4ÓH‰OˆHà˜ÔÙà*/¸Aµ˜ØØÐ*Ð*r   c                óÒ   € V P                   P                  V4       V P                  4       pVR8X  d   V P                  4       pK  V P                   P                  4       ^,
          pW23# )uÙ   Return an offset, byte 2-tuple for the next byte in `stream` that is not
'Ã¿', starting with the byte at offset `start`.

If the byte at offset `start` is not 'Ã¿', `start` and the returned `offset`
will be the same.
ó   ÿ©rh   ÚseekÚ
_read_byteÚtell)r   rs   r�   Úoffset_of_non_ff_bytes   &&  r   r   Ú_MarkerFinder._next_non_ff_byte½   sW   € ð 	�‰×Ñ˜%Ô Ø—‘Ó!ˆØ�wÔØ—O‘OÓ%ŠEØ $§¡× 1Ñ 1Ó 3°aÕ 7ÐØ$Ð+Ð+r   c                óÐ   € V P                   P                  V4       V P                  4       pVR8w  d   V P                  4       pK  V P                   P                  4       ^,
          pV# )uÇ   Return the offset of the next 'Ã¿' byte in `stream` starting with the byte
at offset `start`.

Returns `start` if the byte at that offset is a hex 255; it does not necessarily
advance in the stream.
r„   r…   )r   rs   r�   Úoffset_of_ff_bytes   &&  r   r~   Ú%_MarkerFinder._offset_of_next_ff_byteË   sT   € ð 	�‰×Ñ˜%Ô Ø—‘Ó!ˆØ�wÔØ—O‘OÓ%ŠEØ ŸL™L×-Ñ-Ó/°!Õ3ÐØ Ð r   c                ób   € V P                   P                  ^4      pV'       g   \        R4      hV# )zUReturn the next byte read from stream.

Raise Exception if stream is at end of file.
zunexpected end of file)rh   ÚreadÚ	Exception)r   r�   s   & r   r‡   Ú_MarkerFinder._read_byteÙ   s,   € ð
 —‘×!Ñ! !Ó$ˆßÜÐ4Ó5Ð5Øˆr   rv   )r   r   r   r   r   r<   r2   r%   rp   r   r~   r‡   r   r   rd   re   s   @@r   rn   rn   ›   s:   ù‡ € ÙPõð ñó ðò+ò,,ò!÷ò r   rn   c                óÚ   € V \         P                  8X  d   \        pM>V \         P                  8X  d   \        pM"V \         P
                  9   d   \        pM\        pVP                  WV4      # )zjReturn |_Marker| or subclass instance appropriate for marker at `offset` in
`stream` having `marker_code`.)	r   rX   Ú_App0Markerr_   Ú_App1Markerrb   Ú
_SofMarkerÚ_Markerr%   )rG   r.   rD   Ú
marker_clss   &&& r   rq   rq   ä   sX   € ð Ô&×+Ñ+Ô+Ü ‰
Ø	Ô(×-Ñ-Ô	-Ü ‰
Ø	Ô(×9Ñ9Ô	9Ü‰
äˆ
Ø×!Ñ! &°vÓ>Ð>r   c                   ó†   a a€ ] tR t^òt oRtV 3R lt]R 4       t]R 4       t	]R 4       t
]R 4       t]R 4       tRtVtV ;t# )	r–   ziBase class for JFIF marker classes.

Represents a marker and its segment occuring in a JPEG byte stream.
c                óP   <€ \         \        V `  4        Wn        W n        W0n        R # r:   )r;   r–   r<   Ú_marker_codeÚ_offsetÚ_segment_length)r   rG   rD   rE   r?   s   &&&&€r   r<   Ú_Marker.__init__ø   s!   ø€ ÜŒg�tÑ%Ô'Ø'ÔØŒØ-Ör   c                ót   € \         P                  ! V4      '       d   ^ pMVP                  V4      pV ! W#V4      # )z`Return a generic |_Marker| instance for the marker at `offset` in `stream`
having `marker_code`.)r   Úis_standaloneÚ
read_short)r-   r.   rG   rD   rE   s   &&&& r   r%   Ú_Marker.from_streamþ   s7   € ô ×)Ò)¨+×6Ò6Ø‰Nà#×.Ñ.¨vÓ6ˆNÙ�;¨Ó7Ð7r   c                ó   € V P                   # )ue   The single-byte code that identifies the type of this marker, e.g. ``'Ã '``
for start of image (SOI).)rš   r   s   &r   rG   Ú_Marker.marker_code  s   € ð × Ñ Ð r   c                óD   € \         P                  V P                  ,          # r:   )r   Úmarker_namesrš   r   s   &r   rH   Ú_Marker.name  s   € ä×,Ñ,¨T×->Ñ->Õ?Ð?r   c                ó   € V P                   # r:   )r›   r   s   &r   rD   Ú_Marker.offset  s   € à�|‰|Ðr   c                ó   € V P                   # )z-The length in bytes of this marker's segment.)rœ   r   s   &r   rE   Ú_Marker.segment_length  s   € ð ×#Ñ#Ð#r   )rš   r›   rœ   )r   r   r   r   r   r<   r2   r%   r   rG   rH   rD   rE   r   r   rd   re   s   @@r   r–   r–   ò   sz   ù‡ € ñõ
.ð ñ8ó ð8ð ñ!ó ð!ð
 ñ@ó ð@ð ñó ðð ñ$ó ÷$ð $r   r–   c                   ól   a a€ ] tR tRt oRtV 3R lt]R 4       t]R 4       tR t	]
R 4       tRtVtV ;t# )	r“   i  z&Represents a JFIF APP0 marker segment.c                óT   <€ \         \        V `  WV4       W@n        WPn        W`n        R # r:   )r;   r“   r<   Ú_density_unitsÚ
_x_densityÚ
_y_density)r   rG   rD   ÚlengthÚdensity_unitsÚ	x_densityÚ	y_densityr?   s   &&&&&&&€r   r<   Ú_App0Marker.__init__  s$   ø€ ÜŒk˜4Ñ)¨+¸vÔFØ+ÔØ#ŒØ#Žr   c                ó8   € V P                  V P                  4      # ©zSHorizontal dots per inch specified in this marker, defaults to 72 if not
specified.)Ú_dpir®   r   s   &r   r*   Ú_App0Marker.horz_dpi%  ó   € ð �y‰y˜Ÿ™Ó)Ð)r   c                ó8   € V P                  V P                  4      # ©zQVertical dots per inch specified in this marker, defaults to 72 if not
specified.)r·   r¯   r   s   &r   r+   Ú_App0Marker.vert_dpi+  r¹   r   c                ó�   € V P                   ^8X  d   TpV# V P                   ^8X  d   \        \        VR,          4      4      pV# ^HpV# )z6Return dots per inch corresponding to `density` value.gR¸…ëQ@)r­   ÚintÚround)r   ÚdensityÚdpis   && r   r·   Ú_App0Marker._dpi1  sR   € à×Ñ !Ô#ØˆCð
 ˆ
ð	 × Ñ  AÔ%Ü”e˜G d�NÓ+Ó,ˆCð ˆ
ð ˆCØˆ
r   c                ó¤   € VP                  V4      pVP                  V^	4      pVP                  V^
4      pVP                  V^4      pV ! W#WEWg4      # )zMReturn an |_App0Marker| instance for the APP0 marker at `offset` in
`stream`.)r    Ú	read_byte)r-   r.   rG   rD   rE   r±   r²   r³   s   &&&&    r   r%   Ú_App0Marker.from_stream;  sY   € ð  ×*Ñ*¨6Ó2ˆØ×(Ñ(¨°Ó3ˆØ×%Ñ% f¨bÓ1ˆ	Ø×%Ñ% f¨bÓ1ˆ	Ù�;¨ÀyÓ\Ð\r   )r­   r®   r¯   )r   r   r   r   r   r<   r   r*   r+   r·   r2   r%   r   r   rd   re   s   @@r   r“   r“     sV   ù‡ € Ù0õ$ð ñ*ó ð*ð
 ñ*ó ð*ò
ð ñ]ó ÷]ð ]r   r“   c                   ó†   a a€ ] tR tRt oRtV 3R lt]R 4       t]R 4       t	]R 4       t
]R 4       t]R 4       tR	tVtV ;t# )
r”   iP  z-Represents a JFIF APP1 (Exif) marker segment.c                óH   <€ \         \        V `  WV4       W@n        WPn        R # r:   )r;   r”   r<   Ú	_horz_dpiÚ	_vert_dpi)r   rG   rD   r°   r*   r+   r?   s   &&&&&&€r   r<   Ú_App1Marker.__init__S  s   ø€ ÜŒk˜4Ñ)¨+¸vÔFØ!ŒØ!Žr   c                óÈ   € VP                  V4      pV P                  W4      '       d   V ! W#V^H^H4      # V P                  WV4      pV ! W#WEP                  VP                  4      # )zeExtract the horizontal and vertical dots-per-inch value from the APP1 header
at `offset` in `stream`.)r    Ú_is_non_Exif_APP1_segmentÚ_tiff_from_exif_segmentr*   r+   )r-   r.   rG   rD   rE   Útiffs   &&&&  r   r%   Ú_App1Marker.from_streamX  s_   € ð  ×*Ñ*¨6Ó2ˆØ×(Ñ(¨×8Ò8Ù�{¨N¸BÀÓCÐCØ×*Ñ*¨6¸>ÓJˆÙ�;¨¿¹ÀtÇ}Á}ÓUÐUr   c                ó   € V P                   # r¶   )rÈ   r   s   &r   r*   Ú_App1Marker.horz_dpij  ó   € ð �~‰~Ðr   c                ó   € V P                   # r»   )rÉ   r   s   &r   r+   Ú_App1Marker.vert_dpip  rÒ   r   c                ó^   € VP                  V^,           4       VP                  ^4      pVR8g  # )z—Return True if the APP1 segment at `offset` in `stream` is NOT an Exif
segment, as determined by the ``'Exif  '`` signature at offset 2 in the
segment.s   Exif  )r†   r�   )r-   r.   rD   Úexif_signatures   &&& r   rÌ   Ú%_App1Marker._is_non_Exif_APP1_segmentv  s,   € ð
 	�‰�F˜Q•JÔØŸ™ Q›ˆØ Ñ0Ð0r   c                óº   € VP                  V^,           4       VP                  V^,
          4      p\        P                  ! V4      p\        P
                  ! V4      # )zgReturn a |Tiff| instance parsed from the Exif APP1 segment of
`segment_length` at `offset` in `stream`.)r†   r�   ÚioÚBytesIOr   r%   )r-   r.   rD   rE   Úsegment_bytesÚ	substreams   &&&&  r   rÍ   Ú#_App1Marker._tiff_from_exif_segment  sF   € ð
 	�‰�F˜Q•JÔØŸ™ N°QÕ$6Ó7ˆÜ—J’J˜}Ó-ˆ	Ü×Ò 	Ó*Ð*r   )rÈ   rÉ   )r   r   r   r   r   r<   r2   r%   r   r*   r+   rÌ   rÍ   r   r   rd   re   s   @@r   r”   r”   P  sx   ù‡ € Ù7õ"ð
 ñVó ðVð" ñó ðð
 ñó ðð
 ñ1ó ð1ð ñ+ó ÷+ð +r   r”   c                   óf   a a€ ] tR tRt oRtV 3R lt]R 4       t]R 4       t	]R 4       t
RtVtV ;t# )r•   iŠ  z7Represents a JFIF start of frame (SOFx) marker segment.c                óH   <€ \         \        V `  WV4       W@n        WPn        R # r:   )r;   r•   r<   Ú	_px_widthÚ
_px_height)r   rG   rD   rE   r'   r(   r?   s   &&&&&&€r   r<   Ú_SofMarker.__init__�  s   ø€ ÜŒj˜$Ñ(¨¸nÔMØ!ŒØ#Žr   c                ó€   € VP                  V4      pVP                  V^4      pVP                  V^4      pV ! W#WFV4      # )zJReturn an |_SofMarker| instance for the SOFn marker at `offset` in stream.)r    )r-   r.   rG   rD   rE   r(   r'   s   &&&&   r   r%   Ú_SofMarker.from_stream’  sG   € ð  ×*Ñ*¨6Ó2ˆØ×%Ñ% f¨aÓ0ˆ	Ø×$Ñ$ V¨QÓ/ˆÙ�;¨À)ÓLÐLr   c                ó   € V P                   # )zImage height in pixels.)rá   r   s   &r   r(   Ú_SofMarker.px_height¡  s   € ð �‰Ðr   c                ó   € V P                   # )zImage width in pixels.)rà   r   s   &r   r'   Ú_SofMarker.px_width¦  s   € ð �~‰~Ðr   )rá   rà   )r   r   r   r   r   r<   r2   r%   r   r(   r'   r   r   rd   re   s   @@r   r•   r•   Š  sP   ù‡ € ÙAõ$ð
 ñMó ðMð ñó ðð ñó ÷ð r   r•   )r   rÙ   Údocx.image.constantsr   r   Údocx.image.helpersr   r   Údocx.image.imager   Údocx.image.tiffr   r	   r"   r4   r$   rR   rn   rq   r–   r“   r”   r•   r   r   r   Ú<module>rí      s›   ðñó
 
ç <ß 7Ý ,Ý  ôˆ?ô ô<ˆ4ô <ô$<ˆ4ô <÷"=Cñ =C÷@;ñ ;÷6Fñ FòR?÷'$ñ '$ôT1]�'ô 1]ôh7+�'ô 7+ôt�ö r   