This seems to happen only on one of my forums and not the other, for some reason, despite both being close to the same version of Discourse.
Since a recent update, when images are embedded in posts, the lightbox thumbnail cuts off the sides of the image. This makes it really difficult to read the pictures if they have text.
It doesn’t seem to me like this is desired behavior, and in fact, it’s not happening here on Meta.
I’ve tried restoring the site backup on a new instance, and that also didn’t solve the problem. So it’s obviously a configuration problem, although I honestly don’t know what.
I checked the site and it seems there is no custom css or other customization which affect the thumbnails.
This should be a site setting misconfiguration like:
But you said:
By the way what is the default value on your min ratio to crop setting?
Maybe a CDN misconfiguration? If you use a cloud based image resizer to optimized images (thumbnails). This is not very likely but this could be also a possible reason.
An other possible reason is a plugin which can do things with thumbnails. As Simon suggested you can also try upload new images in safe mode to check this might caused by a plugin. (but as I saw, you don’t use such a plugin.) If I am wrong and you use any plugin like this, sometimes disables the plugin on admin is not enough, in this case you have to comment out (remove) from app.yml and try again…
But note that: These thumbnails are cooked in these sizes and cropped in posts. So if you change anything it won’t affect the existing thumbnails until you rebake the posts or resize these manually to recognize it the system as new file and generate new thumbnail for them. With new uploads these changes should show the changed result after reload the page.
Visited the site in safe mode and the problem persists.
I also tried restoring the site on a different server with a Discourse install with the same app.yml, then rebaking posts, just to test if anything would change, and it didn’t.
0.22, and it’s the exact same in another forum I manage that doesn’t have this problem.
My CDN is just the basic one from Amazon AWS, and it’s with the same settings as another site that doesn’t have this problem.
Unfortunately, I don’t use any plugin that would interact with that. Maybe discourse-topic-previews-sidecar?
I’ve checked inside my AWS S3 bucket, and it seems it’s the optimized version of the images that got cropped. So it’s some sort of bug that’s happening during image upload.
Edit slightly the original picture (so it’s not recognized as an existing images by Discourse, though I’m not sure it is if you paste if from your clipboard),
Disabling it seems to have solved the issue (at least for new pictures).
Would there be any way now to rebuild all of the optimized versions to fix the problem sitewide?
I see there’s a uploads:regenerate_missing_optimized rake task, but as far as I understand it would only regenerate the optimized versions that are missing.
In the end the offending images were few enough that I ended up manually reuploading all of them. So, the problem’s solved, although not in the most efficient manner.