MediaWiki API:嵌入/删除不相关图标的图像的大小

发布于 2024-12-05 09:10:02 字数 218 浏览 1 评论 0原文

我使用 MediaWiki API 来查找 Wikipedia 文章的图像。然而,我也得到了所有无用的图标,比如当文章需要清理时的扫帚,或者标记要放置在知识共享许可下的内容的知识共享徽标。

有没有办法检测哪些图像是此类图标,以便我可以删除它们?例如,有没有一种方法可以查询嵌入图像的大小(而不是原始图像的大小,即使对于图标来说也可能很大),以便我可以删除所有小的图像。无论如何,我对非常小的图像并不感兴趣。

I use the MediaWiki API to find images of Wikipedia articles. However, I also get all the useless icons, like the broom for when a article needs to be cleaned up or the creative commons logo that marks something to be placed under a creative commons license.

Is there a way to detect which images are such icons so I can drop them? E.g. is there a way to query the size at which the image was embedded (rather then the size of the original image, which might be huge even for icons) so that I can drop all small ones. I'm not really interested in very small images anyway.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

关于从前 2024-12-12 09:10:02

据我所知,没有。该信息根本不存储在数据库中,因此也无法通过 API 获取。

您可能可以做的一些事情包括:

As far as I know, no. That information is simply not stored in the database, and is therefore also not available via the API.

Some things you could perhaps do include:

  • Load the HTML markup of the article (via the API action=parse, or simply via index.php with action=render) and extract the image sizes from it.

  • Simply build a list of images that should be excluded. You could do this programmatically (e.g. find all images used on all templates included in Category:Wikipedia maintenance templates and all its subcategories) or just add any unwanted images to the exclusion list as you come across them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文