EdwardBetts / depicts

Wiki Art Depiction Explorer
https://art.wikidata.link/
GNU General Public License v3.0
4 stars 3 forks source link

Better handling of paintings without an image #3

Open fuzheado opened 4 years ago

fuzheado commented 4 years ago

Need to fail gracefully, or fallback to a vanilla mode if there is no OA image as a P18 for the item. Perhaps put a gray placeholder image, and people can still inspect and work with the depiction statements.

Or, if you can see if P4765 "Commons compatible image available at URL" is set, and pull an image from a non-wiki site. That would be quite useful actually.

URL: https://art.wikidata.link/item/Q16038737

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/flask/app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3/dist-packages/flask/app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/flask/_compat.py", line 35, in reraise raise value File "/usr/lib/python3/dist-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1799, in dispatch_request return self.view_functionsrule.endpoint File "/srv/depicts/app.py", line 335, in item_page image_filename = item.image_filename File "/srv/depicts/depicts/painting.py", line 103, in image_filename return self.entity['claims']['P18'][0]['mainsnak']['datavalue']['value'] KeyError: 'P18'

EdwardBetts commented 4 years ago

I've stopped it crashing, but I still need to make the other changes you suggest.

fuzheado commented 4 years ago

In theory, one could do something if the P6108 "IIIF manifest" is set too. Though I don't have a good grasp for how easy/hard that is.

I don't think this is super high priority, but it is a nice enhancement that joins free (Wikimedia) and nonfree (the real world that isn't OA yet) in a way that is novel and useful. We typically operate in this very restricted band of "it must be free, or we can't work with it" mode, whereas there are still meaningful ways we can work with nonfree materials, at least in the metadata.

fuzheado commented 4 years ago

Another possible avenue for investigation - P973 "described at URL" for an item. If it's easy to look at the URL and determine there is a large primary image, we might be able to bring that in, or maybe show a selection of significant images found, and leave it to the user to figure out whether any of the images found are relevant.

fuzheado commented 4 years ago

And another obvious one to look at:

P6500 "non-free artwork image URL"