change_thumbnail_size

Wikipedia errors out on thumbnails with obsolete resolutions with "Error: 429, Use thumbnail steps listed on https://w.wiki/GHai."
Indirectly fixes https://github.com/Nachtzuster/BirdNET-Pi/issues/568 and https://github.com/Nachtzuster/BirdNET-Pi/discussions/441
This commit is contained in:
Canopy2523
2026-02-17 15:41:24 +05:00
committed by Nachtzuster
parent 779325dd8c
commit c5877e6e89
+2 -2
View File
@@ -450,8 +450,8 @@ class Wikipedia extends ImageProvider {
} else {
$license_url = $this->get_external_link($image_url);
}
if ($page["imageinfo"][0]["width"] > 1024) {
$image_url = preg_replace('#/commons/#', '/commons/thumb/', $image_url) . '/1024px-'. $image_name;
if ($page["imageinfo"][0]["width"] > 1280) {
$image_url = preg_replace('#/commons/#', '/commons/thumb/', $image_url) . '/1280px-'. $image_name;
}
}