Skip to content
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

[xExtension-ImageProxy] Duplicate images in articles #206

Open
denis-dysen opened this issue Feb 25, 2024 · 5 comments
Open

[xExtension-ImageProxy] Duplicate images in articles #206

denis-dysen opened this issue Feb 25, 2024 · 5 comments
Labels
xExtension-ImageProxy xExtension-ImageProxy

Comments

@denis-dysen
Copy link

With the proxy enabled, every article that has an image in it, has its first (or only) image duplicated, with the duplicate image being located at the end of the article, and checking the image URLs reveals the duplicate is at the end is the original non-proxied link, while all other images links are proxied.

@Frenzie
Copy link
Member

Frenzie commented Feb 25, 2024

I suspect you're talking about the same thing as FreshRSS/FreshRSS#4999

@math-GH
Copy link
Contributor

math-GH commented Mar 4, 2024

I investigated it a bit.

Here are some insights, that roots are in ImageProxy extension:
It wraps the images in a new HTML document "envelope" that completely destroys the HTML:

<div class="text"> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><img>........</body></html>
<figure class="enclosure">

(check it with the "show source" in your browser, not with the inspect tool)

In the last new versions of FreshRSS a new feature was implemented that prevent showing duplicated images from the articles as attachment based on the image source. The imageProxy extension exchanges the src of the image to the proxy URL, so the mechanisms cannot detect this image as already shown, so the image will be displayed again as attachement with the origin source.

If you manipulated

$img->setAttribute('src', $newSrc);
to $img->setAttribute('data-proxy-src', $newSrc); than there are no duplicated images anymore and the data-proxy-src is set correctly.

(I do not have any solution for it right now)

(P.S.: To have a better testing: enable the Proxy HTTPS checkbox in the extension settings)

@math-GH math-GH added the xExtension-ImageProxy xExtension-ImageProxy label Mar 4, 2024
@Frenzie
Copy link
Member

Frenzie commented Mar 4, 2024

It wraps the images in a new HTML document "envelope" that completely destroys the HTML:

That's unavoidable. But it's supposed to do something like $dom->getElementsByTagName('body')->item(0).

@jonsmy
Copy link

jonsmy commented Apr 7, 2024

Have this problem as well. In the default FreshRSS release feed I get two avatar images: One from my proxy, and another directly linking to github. :/

@alithechemist
Copy link

alithechemist commented Aug 4, 2024

Same here: double images, the original and the one from the proxy.
Also the thumbnails seem unaffected (still pulled from original website).
I'm using this extension just to avoid clients downloading images from third parties websites other that Freshrss, for privacy purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
xExtension-ImageProxy xExtension-ImageProxy
Projects
None yet
Development

No branches or pull requests

5 participants