Inline preview images are sometimes cut off left or right by one pixel

Example here:

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?

Why not add the border using CSS?

1 Like

Sounds like a lot of effort for something that the tools should do automatically in my opinion.

It’s 1 line of css.

Also, we can’t predict how ImageMagick will scale down an image. We can’t ensure that 1 pixel borders are never removed…

1 Like

How about something like this?

Sure, feel free to write a whole plugin to overwrite how Discourse generates thumbnails (instead of 1 line of CSS) just to add borders :wink:

1 Like

Actually, I do not want borders. I want the images to be scaled to respect the very left and very right pixels.

Why does this matter if it is only in the preview?

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.

1 Like

I tried to explain this:

…when a white window on a white website is shown, the user sees no visual border.