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?
Markus
Hi Markus,
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.
Regards,
Kaloyan
Telerik
Dear Kaloyan
Here we go
www.marktold.com/.../sf_7_0_thumb_border.swf
www.marktold.ch/.../untitled-1.tmb-vga.jpg
vs.
www.marktold.ch/.../untitled-1.jpg
Markus
Hello Markus,
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.
Regards,
Svetoslav Manchev
Telerik
Dear Svetoslav
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
???
Markus
Hi Marcus,
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.
Regards,
Svetoslav Manchev
Telerik
Dear Svetoslav
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)
g.DrawImage(postedFile, outRect)
(worked flawlessly)
Might be something to look at.
Markus
PS as well as this: stackoverflow.com/.../c-sharp-resized-images-have-black-borders
Hello Marcus,
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.
Regards,
Svetoslav Manchev
Telerik