Images produce unlink icon when copied locally

AI-generated summary

A user, icaria36, is experiencing an issue where images from their WordPress blog (https://spa ce.wmflabs.org/) are not being copied locally to their Discourse instance (https://discuss-space.wmflabs.org/) when published through the WP-Discourse plugin. Instead, an unlinked icon is displayed.

The images render fine when uploaded manually and when copied to a different Discourse instance. icaria36 has checked the download remote images to local site setting and it is not disabled. They have also tried copying images from other sources, which work fine.

Icaria36 has narrowed down the issue to only occur when copying images from https://space.wmflabs.org/ to their specific Discourse instance. Other Discourse instances can copy images from this source without issue.

Icaria36 has also tried uploading the image to the media library and linking to it, but the issue persists. Simon suggested trying to copy an image from the problem source before publishing through WP-Discourse, but this did not resolve the issue.

Icaria36 has noted that pasting the image URL directly into a post renders the image, but this does not work in the affected instance.

Hi, we have a WordPress connected to Discourse. The images of the blog post are pub;lished correctly in Discourse, but they are lost when the automatic production of the local copy starts. An unlinked icon is shown instead. Rebuilding the HTML makes the images appear again… and disappear when they are changed by a local copy.

For what is worth, the images render just fine when uploaded manually.

The blog post: New advanced mobile contribution features coming to mobile – Diff

The corresponding topic with the missing images: https://discuss-space.wmflabs.org/t/new-advanced-mobile-contribution-features-coming-to-mobile/437

In fact, let me copy the same HTML here to see whether this bug can be reproduced in this instance:

Hm. They do render here… Now I’m even more confused. Any hints?

1 Like

Have you disabled the download remote images to local site setting?

I tried copying the image tags from this post that are failing for you to my hosted Discourse site. Discourse is automatically downloading the images for me. They display without any issue.

4 Likes

No. In fact, in that topic the first image (jpeg from Wikimedia Commons) is successfully copied locally and displayed while the other two (png from our Discourse) are not. See https://discuss-space.wmflabs.org/t/new-advanced-mobile-contribution-features-coming-to-mobile/437

I wonder whether file format, image size or file size have anything to do with this problem. png’s are allowed in our instance. We are running v2.4.0.beta1 +50.

I’m quite puzzled by this problem, which can be reproduced in our instance after upgrading to v2.4.0.beta1 +225 as well.

???

We don’t even know hot to debug this. There is nothing we have found in the diffs or error logs in Discourse. Strange.

Have you tried copying an image from https://space.wmflabs.org/ into a post on https://discuss-space.wmflabs.org/ that has not yet been published to Discourse from WordPress? Does this make any difference?

Apparently not. :frowning:

https://discuss-space.wmflabs.org/t/testing-images-copied-automatically/455/12

I uploaded the image to the media library and then linked to it from Discourse without the WP-Discourse publishing process in between.

I’ll link to it here just to see it working here and cry. :slight_smile:

Same source:

![](upload://zz0muBQZNCajH7d2ePNM9uqhYNO.png)

1 Like

Another detail that I just realized is that here pasting https://space.wmflabs.org/wp-content/uploads/2019/07/CC0_button.svg_.png renders the image, while the same doesn’t in the other instance.