Open krysal opened 1 year ago
Upload an Image: First, upload your image to Wikimedia Commons.
Edit a Page: Go to the Wikimedia page where you want to add the thumbnail.
Add Image Link: Use double square brackets and the "File:" prefix to link to your image, like this: [[File:YourImageFilename.jpg]].
Customize Thumbnail: If needed, adjust the thumbnail's size, position, and caption within the brackets, like this: [[File:YourImageFilename.jpg|thumb|right|250px|Caption for the image]].
Save the Page: Save the page to display your thumbnail.
We've started generating thumbnail URLs on the fly for Wikimedia in #4736. Do we still need proper thumbnail URLs in the catalogue for Wikimedia? One of the difficulties is that the Wikimedia thumbnail endpoint also supports compression and resizing. Building them in the API means we have finer grained control over where we send parameters for those things, which also improves our ability to serve thumbnails for TIFFs and other formats Photon does not support. Using static thumbnail URLs in the catalogue would limit our ability to take advantage of that.
Can we close this issue in favour of the solution in #4736 or do y'all feel that is only a stop-gap, and a catalogue based approach would be better suited?
I have seen this and will respond to this discussion when I have time!
Sounds good. I was mostly expecting @krysal to reply as the author of the issue, just to clarify.
Problem
Related to #2442, we have seen tiff images coming from Wikimedia, so while that issue gets solved, we can also add thumbnails to these images and prevent situations where the browser can't show the image, like the following case:
https://openverse.org/image/3caf9d55-f9b3-471b-9ce2-926fdb07a0e4
Description
We can get the thumbnail of the width we want appending the param
iiurlwidth=<desired_number>
to the API endpoint, e.g: https://commons.wikimedia.org/w/api.php?action=query&titles=File:Albert%20Einstein%20Head.jpg&prop=imageinfo&iiprop=url|user|dimensions|extmetadata|mediatype|size&iiurlwidth=600One possible issue with this is that the documentation says:
Our current batch limit is set to 250.
Additional context
Source: https://wmds-archive.toolforge.org/t/accessing-a-commons-thumbnail-via-wikidata/499/