uwe_keim reports that inline preview images are sometimes cut off by one pixel, specifically when the image has a one-pixel wide border and a white background. This issue only occurs in the preview. uwe_keim seeks a configuration solution to make the image scaling algorithm respect the leftmost and rightmost pixels of an image. zogstrip suggests adding a border using CSS, but uwe_keim prefers a more automatic solution. zogstrip notes that ImageMagick’s scaling behavior is unpredictable, making it challenging to ensure that one-pixel borders are preserved. Stephen suggests that the issue lies with ImageMagick’s image resampling, rather than Discourse, and recommends approaching ImageMagick for a solution. codinghorror tests an image with a purple border and finds that the issue may have been fixed upstream.
There are several screenshots in the above posting, and when it comes to fully white windows with a one pixel wide border, these borders sometimes get cut off left or right.
It only happens in the preview.
This looks rather ugly, because when a white window on a white website is shown, the user sees no visual border.
I sometimes add a one-pixel transparent border left or right, to outsmart the scaling algorithm.
My question:
Is there something I can configure to make the scaling algorithm for images work perfectly, even for the leftmost and rightmost pixels of an image?
But the “solution” you linked adds borders to every image, which most sites wouldn’t want. Your problem isn’t with Discourse, it’s with the way in which images are resampled when ImageMagick scales them down. Adding a border to the image has more of an impact than the CSS change, which by your own admission you don’t want.
Why not approach ImageMagick and see if they have a solution rather than blaming Discourse, which isn’t responsible. This isn’t a Discourse problem in the slightest.