danbooru / danbooru

A taggable image board written in Rails.
Other
2.26k stars 416 forks source link

Exception on IQDB query with URL parameter #4023

Closed BrokenEagle closed 4 years ago

BrokenEagle commented 5 years ago

This issue was noticed when trying out the following image URL.

  {
    "success": false,
    "message": "no implicit conversion of String into Integer",
    "backtrace": ["app/logical/iqdb_proxy.rb:15:in `[]'","app/logical/iqdb_proxy.rb:15:in `block in decorate_posts'","app/logical/iqdb_proxy.rb:13:in `each'","app/logical/iqdb_proxy.rb:13:in `map'","app/logical/iqdb_proxy.rb:13:in `decorate_posts'","app/logical/iqdb_proxy.rb:9:in `query'","app/controllers/iqdb_queries_controller.rb:8:in `show'"]
  }

However, the exception only occurs when using the URL parameter. When using the URL text input on the /iqdb_queries HTML endpoint which uses the callback functionality instead, it correctly identifies the correct image/post.

I'm not sure if this is relevant or not, but the medium size of that image is the only one that is still working. All of the other images sizes give HTTP 404 responses.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

BrokenEagle commented 4 years ago

This should be fixed now that #4481 has been merged. The problem was is that the url parameter selects the smallest image available, which on Twitter is the :small size, which is a bad image link. Users can now just use the image URL sizes that work with the image_url parameter.