Image

Image

This module is the data model for an image on a page

EXAMPLES:

>>> sample_image
image at (0.13,0.605):(0.455,0.739)
class quill.image.Image(uuid, x0, x1, y0, y1, constrain_aspect, jpg_data)[source]

Bases: quill.graphics_object.GraphicsObject

Embedded image on a page.

constrain_aspect()

Whether the aspect ratio should be constrained when resizing.

Return type:boolean

EXAMPLES:

>>> sample_image.constrain_aspect()
True
data()

Return the image data (jpg).

Return type:string

EXAMPLES:

>>> sample_image.data()    
'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00...
uuid()

Return the image uuid.

Return type:string

EXAMPLES:

>>> sample_image.uuid()
'ce34de3c-daeb-4a81-8620-e170441946c1'
x0()

Return the minimum x-coordinate.

Return type:float

EXAMPLES:

>>> sample_image.x0()
0.12979288399219513
x1()

Return the maximum x-coordinate.

Return type:float

EXAMPLES:

>>> sample_image.x1()
0.4552972912788391
y0()

Return the minimum y-coordinate.

Return type:float

EXAMPLES:

>>> sample_image.y1()
0.7390127182006836
y1()

Return the maximum y-coordinate.

Return type:float

EXAMPLES:

>>> sample_image.y1()
0.7390127182006836

Previous topic

Pen Stroke

Next topic

Straight Line

This Page