on_image_resource_ready method
on_image_resource_ready
Called for each raster image in SVG. Use it to specify how to store the raster image.
Returns
Should return path to saved resource. Path will be used in SVG image to refer to raster content. Path should be relative to target SVG document.
def on_image_resource_ready(self, image_data, image_type, suggested_file_name, use_embedded_image):
...
Parameter | Type | Description |
---|---|---|
image_data | bytes | The bytes of the raster image content |
image_type | SvgImageType | Type of the image. |
suggested_file_name | str | Name of the suggested file. |
use_embedded_image | any | if set to true then image will be embedded into SVG. |