404 Error when Importing SVG Image in PowerPoint Presentation

attempted to add an SVG image to a slide but encountered an error. Here’s the error traceback:

  File "/home/spericorn/Documents/project/fca_venv/lib/python3.8/site-packages/asposeslidescloud/apis/slides_api.py", line 22041, in import_shapes_from_svg
    (data) = self.import_shapes_from_svg_with_http_info(name, slide_index, image, x, y, width, height, shapes, group, password, folder, storage, **kwargs)  # noqa: E501
  File "/home/spericorn/Documents/project/fca_venv/lib/python3.8/site-packages/asposeslidescloud/apis/slides_api.py", line 22139, in import_shapes_from_svg_with_http_info
    return self.api_client.call_api(
  File "/home/spericorn/Documents/project/fca_venv/lib/python3.8/site-packages/asposeslidescloud/api_client.py", line 352, in call_api
    return self.__call_api(resource_path, method,
  File "/home/spericorn/Documents/project/fca_venv/lib/python3.8/site-packages/asposeslidescloud/api_client.py", line 130, in __call_api
    response_data = self.__call_api_with_refresh(
  File "/home/spericorn/Documents/project/fca_venv/lib/python3.8/site-packages/asposeslidescloud/api_client.py", line 177, in __call_api_with_refresh
    raise ex
  File "/home/spericorn/Documents/project/fca_venv/lib/python3.8/site-packages/asposeslidescloud/api_client.py", line 167, in __call_api_with_refresh
    raise ex
  File "/home/spericorn/Documents/project/fca_venv/lib/python3.8/site-packages/asposeslidescloud/api_client.py", line 151, in __call_api_with_refresh
    return self.request(method, url,
  File "/home/spericorn/Documents/project/fca_venv/lib/python3.8/site-packages/asposeslidescloud/api_client.py", line 396, in request
    return self.rest_client.POST(url,
  File "/home/spericorn/Documents/project/fca_venv/lib/python3.8/site-packages/asposeslidescloud/rest.py", line 289, in POST
    return self.request("POST", url,
  File "/home/spericorn/Documents/project/fca_venv/lib/python3.8/site-packages/asposeslidescloud/rest.py", line 244, in request
    raise ApiException(http_resp=r)
asposeslidescloud.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Date': 'Mon, 02 Sep 2024 10:16:26 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '472', 'Connection': 'keep-alive', 'server': 'nginx/1.19.9'})
HTTP response body: AmazonS3 Storage exception: The specified key does not exist. Bucket 'aspose.cloud-filestorage-prod', FilePath '869085/45099399-20b8-486a-9af3-e3b542072ef6/ppt/dev/region PPT_QA Admin_09_02_2024_06_16_19.pptx'

Parameters Used in the API Call:

file_name: region PPT_QA Admin_09_02_2024_06_16_19.pptx
slide_index: 1
folder_name: ppt/dev/
aspose_storage: Report

I checked, and the file does exist in the specified folder_name path in Aspose. However, the SVG image insertion still fails.

@HPLINC,
Thank you for contacting support.

We are sorry that you have to encounter this problem. Unfortunately, I was unable to reproduce the error you described. Please check carefully if the file exists again. If the issue persists, please share the following files and information:

  • “region PPT_QA Admin_09_02_2024_06_16_19.pptx” file
  • SVG image file
  • code example to reproduce the error
  • Aspose.Slides Cloud SDK version you used

region PPT_QA Admin_09_02_2024_03_45_42.zip (25.8 KB)

Aspose.Slides Cloud SDK version - asposeslidescloud==23.4.0

code Example

def import_shape_from_svg(file_name, image,  x_axis=25, y_axis=96, width=666, height=400, folder=None, storage=None, slide_index=1):
    asposeslidescloud.SlidesApi.import_shapes_from_svg(file_name, slide_index, source, x_axis, y_axis, width, height, None,
                                                          folder=folder, storage=storage)

@HPLINC,
Thank you for the issue details. I am working on the issue and will get back to you soon.

@HPLINC,
Thank you for your patience.

I created a storage called “Report”, added a folder called “ppt” and a folder called “dev” inside “ppt”, and ran the following code:

storage_name = "Report"
folder_path = "ppt/dev/"
file_name = "region  PPT_QA Admin_09_02_2024_03_45_42.pptx"

slide_index = 1

image_path = "SVG_file.svg"
x = 25
y = 96
width = 666
height = 400

with open(image_path, "rb") as image_stream:
    slides_api.import_shapes_from_svg(
        file_name, slide_index, image_stream, x, y, width, height, 
        None, None, None, folder_path, storage_name)

No errors appeared. Please try to localize the problem using the code above.