0

IO Error code 422 - failed to load and process image
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

IO Error code 422 - failed to load and process image

by jliu70 on Mon Mar 15, 2021 3:36 pm

So re-posting in this channel since it might be related to Adafruit IO image conversion service.

Original forum post:
viewtopic.php?f=60&t=176411

Trying to load images on a Titano from the Cleveland Museum of Art demo.

I think this may be related to the Adafruit IO service which is being called to convert the images from JPG to BMP16.

Receive error code 422
Code: Select all | TOGGLE FULL SIZE
original URL: https://openaccess-cdn.clevelandart.org/1940.672/1940.672_web.jpg
convert URL: https://io.adafruit.com/api/v2/jliu70/integrations/image-formatter?x-aio-key=secretKey&width=480&height=305&output=BMP16&url=https://openaccess-cdn.clevelandart.org/1940.672/1940.672_web.jpg
Fetching stream from https://io.adafruit.com/api/v2/jliu70/integrations/image-formatter?x-aio-key=secretKey&width=480&height=305&output=BMP16&url=https://openaccess-cdn.clevelandart.org/1940.672/1940.672_web.jpg
Traceback (most recent call last):
  File "code.py", line 57, in <module>
  File "code.py", line 46, in <module>
  File "adafruit_pyportal.py", line 1106, in fetch
  File "adafruit_pyportal.py", line 1103, in fetch
  File "adafruit_pyportal.py", line 1083, in fetch
  File "adafruit_pyportal.py", line 1077, in fetch
  File "adafruit_pyportal.py", line 781, in wget
HttpError: Code 422: Unprocessable Entity

Code done running.




So the API call is for the "Fetching stream from ....." line.

When I attempt to call the URL directly in the browser, I receive the following:

Code: Select all | TOGGLE FULL SIZE
{"error":"request failed - failed to load and process image"}



If I call the original URL from the Cleveland Museum of Art within the browser, it works.

Code: Select all | TOGGLE FULL SIZE
https://openaccess-cdn.clevelandart.org/1940.672/1940.672_web.jpg


So since fetching the original Cleveland Museum of Art image image works, and that this is also affecting NASA Photo of the Day, that implies that there could be something wrong with the AIO image conversion to BMP16 service.

Not sure if someone at Adafruit can help check and see if that's the case?

Thanks!

jliu70
 
Posts: 46
Joined: Wed Oct 21, 2020 9:27 pm

Re: IO Error code 422 - failed to load and process image

by jwcooper on Mon Mar 15, 2021 6:10 pm

Hi, could you give this a try again? This service should be repaired now.

Thanks!

Justin

jwcooper
 
Posts: 785
Joined: Tue May 01, 2012 9:08 pm

Re: IO Error code 422 - failed to load and process image

by jliu70 on Mon Mar 15, 2021 7:11 pm

Confirm that it works. Thanks!

jliu70
 
Posts: 46
Joined: Wed Oct 21, 2020 9:27 pm

Please be positive and constructive with your questions and comments.