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

Previews lose images if the image moves #30148

Open
billkendrick opened this issue May 2, 2024 · 0 comments
Open

Previews lose images if the image moves #30148

billkendrick opened this issue May 2, 2024 · 0 comments
Labels
area/web interface Related to the Mastodon web interface bug Something isn't working status/to triage This issue needs to be triaged

Comments

@billkendrick
Copy link

Steps to reproduce the problem

After moving image files on my webserver to new URLs, Mastodon posts where I linked to pages that included those images are no longer showing them in the previews -- despite both updating og:image and creating HTTP redirects from the images' old URLs to their new ones.

Expected behaviour

Previews of images on my links should [continue] to appear

Actual behaviour

Previews of images on my links have all disappeared

Detailed description

Today on my webserver, I moved a large collection of image files from a single directory into subdirectories (e.g., "abc.png" went into "a/abc.png"; "xyz.jpg" went into "x/xyz.jpg").

My pages that show these images, e.g., https://tuxpaint.org/gallery/image.php?i=ethans-death-and-taxes-by-reddit-crankgameplays.png, have been update to not only use the correct path in the <img src> tag, but the <meta property="og:image" ...> has as well.

Furthermore, for situations where someone or something (cough previews on posts made to Meta Threads) still expected to find the image at the original location, I have set up a 404 error handler on my webserver that detects the old URLs for these images (e.g., "/gallery/images/whatever.png"), and uses a Location: HTTP header to redirect to the new URL (e.g., "/gallery/images/w/whatever.png").

Unfortunately, when I look at my older posts to my Mastodon account, all of the link previews now show a generic "document" icon in a big great box, rather than a thumbnail of the og:image image. 😞

Example: https://floss.social/@tuxpaint/112312826625820531

Compare to a more recent post (after I had moved the images into subdirectories): https://floss.social/@tuxpaint/112370349577998010

Mastodon instance

floss.social

Mastodon version

v4.2.8

Browser name and version

Chrome 124.0.6367.91

Operating system

Ubuntu 22.04.4

Technical details

No response

@billkendrick billkendrick added area/web interface Related to the Mastodon web interface bug Something isn't working status/to triage This issue needs to be triaged labels May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web interface Related to the Mastodon web interface bug Something isn't working status/to triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant