-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images in instant answer are not loaded if "image proxy" is enables #875
Comments
I can confirm that the image is not loaded:
But the URL (now without image_proxy) ... |
If wikidata is enabled the image is broken. |
Indeed, this it it. Disabling wikidata, everything works as expected on my instance. |
@return42 Does the image proxy have a size limit? |
It seems the img URL from Wikidata's PNG is redirected (twice) while the URL of the JPG from wikipedia is not redirected |
I am currently working on a solution. I think I can do a PR soon. |
Thanks .. I also working on a solution ;-) .. I just stuck at the meaning of priority . and why it must be lower: searxng/searx/engines/wikidata.py Lines 223 to 225 in 10e6881
EDIT: I think image proxy should support redirects |
Maybe but then image proxy would do 2 redirects for every wikidata image. I don't think this would be good for performance. |
This arguments counts .. I just think about rewrite the image URL in the wikidata engine ... needs some more analysis .. I just digging :) |
OK, if I'm not wrong all images from commons.wikimedia.org are redirected to upload.wikimedia.org .. may be it is better we do not use images from commons.wikimedia.org in the info box. Another issue seems the lower priority condition in searxng/searx/engines/wikidata.py Lines 223 to 225 in 10e6881
|
@return42 |
@tiekoetter: I cloned your branch .. wow, very cool ..
from where did you know it? I have never thought that it is the prefix of md5 digest. Do you like to send a PR .. in the PR we can do some polish, but the md5 digest is the solution I think. |
https://stackoverflow.com/questions/33689980/get-thumbnail-image-from-wikimedia-commons I will send the PR now. |
Openstreatmap images are now loaded from uploads.wikimedia.org instead of commons.wikimedia.org to prevent redirects. With `image_proxy` enabled images from commons.wikimedia.org cant be loaded since they are redirected. We already discussed this issue [875] and @tiekoetter fixed this issue in PR [878]. Related-to: - [875] searxng#875 - [878] searxng#878 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
SearXNG Version: 1.0.0-1669-10e6881c
Simple theme is used
How did you install SearXNG?
SearxNG was installed by "installation scripts", without Morty or Filtron.
What happened?
If "image proxy" is enabled, images searches work correctly. However, images in "Instant Answers" under the "General" category are absent and just a broken image placeholder is shown.
For instance, if I search for "Enrico Fermi" in the General category, with the Image Proxy enabled Wikipedia's image is broken.
How To Reproduce
This bug is reproducible. Just enable "Image Proxy" an settings GUI and perform the aforementioned search
Expected behavior
An image should be displayed in place of the broken image placeholder
Screenshots & Logs
Expected result:
![expected](https://user-images.githubusercontent.com/25054477/152677025-85823d66-728c-4f6b-850a-9722c67bc474.png)
Actual result:
![actual](https://user-images.githubusercontent.com/25054477/152677023-0821723f-bae7-44db-a9a8-c46d47e75ebb.png)
Inspection of the page source gives the following:
<img src="/image_proxy?url=https%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FSpecial%3AFilePath%2FEnrico%2520Fermi%25201943-49.jpg%3Fwidth%3D500%26height%3D400&h=dff389296b41618681172e6ca9f6a4e50b6ad32554484ff828889e64f4a419ab" title="Enrico Fermi" alt="Enrico Fermi">
Somewhat "image_proxy" is misbehaving on the home page.
The text was updated successfully, but these errors were encountered: