Thumbs of .jpg on white background get border
Anyone else haveing the problem that the Sitefinity generated thumb images of .jpg with white background produce a gray border in the image?
I was not able to replicate similar issue using 6.3 and 7.0. Can you please send us some screenshots or a short video to illustrate the problem? It will be also great if you can attach and a sample image which I can use to test on my end.
Thank you for the provided video and sample image.
I have tested the scenario with your image and samples of jpeg and png by using original size, build-in size options and custom size option (please find the comparison).
The only issue reproduced is with the sample image provide and by using the custom size.
1) did you use .jpg on your two image
2) did you try both : create thumbs for the library and let the image be created to its size automatically (lazy)
And what is the bottom line then?
a) I have a bad source image
b) just don't use custom size
I have tested your scenario with a blank image in jpg format with the original size of your image (800x800px) and reproduce the issue with the custom thumbnail size (320x240px). The same is not valid for example to png format that I have tested also.
As we are using standard .Net functionality for that resizing this behaviour could not be changed for the time being. You could check System.Drawing.Graphics class if the result is the same.
So I would recommend you to use thumbnail size without such issue or use another image format, when you have white image background.
From the web
I had a similar problem, and learned the following:
g.DrawImage(postedFile, -1, -1, width + 1, height + 1) (this left a border on the right and bottom of my image)
g.DrawImage(postedFile, -1, -1, width + 2, height + 2)
(no border, but lost a pixel, and I don't want to die over a lousy pixel)
Dim outRect As New RectangleF(-0.5, -0.5, width + 1, height + 1)
Might be something to look at.
PS as well as this: stackoverflow.com/.../c-sharp-resized-images-have-black-borders
Thank you for the provided additional information. I have forwarded it to our developers. In case there is some development in that direction I will update this thread.