thumbor / thumbor

thumbor is an open-source photo thumbnail service by globo.com
http://thumbor.org
MIT License
9.91k stars 824 forks source link

Uploading SVG - 'Context' object has no attribute 'request' #1628

Closed koloboid closed 2 months ago

koloboid commented 6 months ago

Hi folks, I caught some errors while uploading SVG files to the thumbor. On the 6.x versions of thumbor uploading SVG works fine. But I've tried Minimalcompact's latest versions, 7.6, and 7.5, and also tried a fresh install from pip - all the same error:

2023-12-02 11:38:22 thumbor:ERROR ERROR: Traceback (most recent call last):
  File .../tmp/lib/python3.11/site-packages/tornado/web.py", line 1790, in _execute
    result = await result
             ^^^^^^^^^^^^
  File ".../tmp/lib/python3.11/site-packages/thumbor/handlers/upload.py", line 40, in post
    if self.validate(body):
       ^^^^^^^^^^^^^^^^^^^
  File ".../tmp/lib/python3.11/site-packages/thumbor/handlers/__init__.py", line 1044, in validate
    engine.load(body, None)
  File ".../tmp/lib/python3.11/site-packages/thumbor/engines/__init__.py", line 199, in load
    buffer = self.convert_svg_to_png(buffer)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../tmp/lib/python3.11/site-packages/thumbor/engines/__init__.py", line 177, in convert_svg_to_png
    output_width=self.context.request.width,
                 ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Context' object has no attribute 'request'

2023-12-02 11:38:22 tornado.access:ERROR 500 POST /image (127.0.0.1) 2.38ms

This happens with all SVG files I tried, and the same files work fine on the thumbor version 6.7.5 Can you point me please - what's going wrong and how to fix it?

Thumbor request URL

POST /image with the SVG content as a body

Operating system

ArchLinux, minimal-compact docker image

github-actions[bot] commented 5 months ago

This issue is stale because it has been open 30 days with no activity. Remove the stale label or add a comment, or this issue will be closed in 15 days. You can always re-open if you still feel this is still an issue. Tag @heynemann for more information.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove the stale label or add a comment, or this issue will be closed in 15 days. You can always re-open if you still feel this is still an issue. Tag @heynemann for more information.

github-actions[bot] commented 2 months ago

This issue was closed because it has been stale for 15 days with no activity.