[openstreetmap/openstreetmap-website] Fetch Wikidata preview thumbnails at a fixed height (PR #7433)

Sachin Kumar notifications at github.com
Mon Sep 28 17:21:19 UTC 2026


@sachin9058 commented on this pull request.



> @@ -164,3 +166,29 @@ function renderWikidataResponse({ icon, label, article, description }, $link) {
   }
   return $("<tr>").append(cell);
 }
+
+function fetchCommonsThumbnail(filename) {
+  const isVectorImage = filename.toLowerCase().endsWith(".svg");
+  const params = new URLSearchParams({
+    action: "query",
+    format: "json",
+    origin: "*",
+    prop: "imageinfo",
+    titles: "File:" + filename,
+    iiprop: "url"
+  });
+  if (!isVectorImage) params.set("iiurlheight", "32");

Thanks, I’ve moved iiurlheight into the main parameter list..

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7433#discussion_r4125072105
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/7433/review/5342274919 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260928/93a7a0dd/attachment.htm>


More information about the rails-dev mailing list