HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/svgwrite/__pycache__/image.cpython-37.opt-1.pyc
B

��Dq�g�U�@s<ddlmZddlmZmZmZmZGdd�deee�ZdS)�)�BaseElement)�	Transform�_vert�_horiz�Clippingcs8eZdZdZdZd
�fdd�	Zdd�Zddd�Z�ZS)�Imagea% The **image** element indicates that the contents of a complete file are
    to be rendered into a given rectangle within the current user coordinate
    system. The **image** element can refer to raster image files such as PNG
    or JPEG or to files with MIME type of "image/svg+xml".

    ZimageNcs^tt|�jf|�||d<|dk	r:|d|d<|d|d<|dk	rZ|d|d<|d|d<dS)	a0
        :param string href: hyperlink to the image resource
        :param 2-tuple insert: insert point (**x**, **y**)
        :param 2-tuple size: (**width**, **height**)
        :param dict attribs: additional SVG attributes
        :param extra: additional SVG attributs as keyword-arguments
        z
xlink:hrefNr�x��y�widthZheight)�superr�__init__)�selfZhref�insert�sizeZextra)�	__class__��?/opt/alt/python37/lib/python3.7/site-packages/svgwrite/image.pyr
szImage.__init__cCsd|d<dS)zh Stretch viewBox in x and y direction to fill viewport, does not
        preserve aspect ratio.
        Znone�preserveAspectRatioNr)rrrr�stretch&sz
Image.stretch�center�middle�meetcCs:|jr|dkrtd|��dt|t||f|jd<dS)ai Set the preserveAspectRatio attribute.

        :param string horiz: horizontal alignment ``'left'|'center'|'right'``
        :param string vert: vertical alignment ``'top'|'middle'|'bottom'``
        :param string scale: scale method ``'meet'|'slice'``

        ============= ===========
        Scale methods Description
        ============= ===========
        ``meet``      preserve aspect ration and zoom to limits of viewBox
        ``slice``     preserve aspect ration and viewBox touch viewport on all bounds, viewBox will extend beyond the bounds of the viewport
        ============= ===========

        )r�slicezInvalid scale parameter '%s'z%s%s %srN)�debug�
ValueErrorrrZattribs)rZhorizZvertZscalerrr�fit,sz	Image.fit)NN)rrr)	�__name__�
__module__�__qualname__�__doc__Zelementnamer
rr�
__classcell__rr)rrrs
rN)Z
svgwrite.baserZsvgwrite.mixinsrrrrrrrrr�<module>	s