Resized images
-
Not sure when exactly this started to happen, but I now get broken images on my site - for example
According to the console, the original attachment is suffixed with
-resized
but I do not see a corresponding file, so the render fails./assets/uploads/files/1656084919400-blurred-resized.png
does not exist, but/assets/uploads/files/1656084919400-blurred.png
does.Any ideas? Currently running
3.8.3
.Whilst not the same topic, there seems to be a relationship in the form of
resized
with this topic -
@phenomlab good morning Mr I have a question for you about creating home page like categories page . can you help me with that?
-
@phenomlab are you running latest version of nodebb now? Did this happen to any new uploads? I haven't been able to reproduce this myself.
Can you put a console log on this line and see if it deletes any resized images? The following should work.
console.log('deleting files', filePaths, new Error('test').stack);
-
@phenomlab I just ran head-first into this.
The issue is that when you upload a picture to NodeBB, we run it through an image processor to resize it. We name that file
{original-filename}-resized.png
.When the picture is added to the post, the resized version is the one that is inserted into the composer. (I don't know if this is still the case because this isn't happening for me right now)
But when you click on it, NodeBB transparently removes any
-resized
suffix and shows you the original, full-size image.However, if your image's original filename ended with
-resized
, then when it got chopped off, of course it 404s.Now that I can reproduce the issue, I'll take a look.
-
@phenomlab Can you try with the latest commit on
develop
?https://github.com/NodeBB/NodeBB/commit/1268ed50cadb944e9bf2f47c30067b8b609a40f1
-
@julian not fixed it seems - see
https://sudonix.org/topic/418/v3-harmony-diary-thoughts-code-snippets/41?_=1731000122082
As you can see below
Removing "resized" makes the image show, but not if left as is.