I have encountered a weird issue, which is that sometimes when I upload .PNG images to my SharePoint Image Libraries, sometimes they get converted to .JPG, BUT when I open the image from the library it gets converted back to .PNG.

I make sure that all the images are indeed .PNG on my local drive just in case, and they are.

2 Answers
2

Are you talking about the automatic resizes created when you upload an image to a picture library. Typically it will create an 160px max and 640px max and put them in the _t and _w folders of the library respectively. When this is done the resizes are always jpgs. When browsing from a picture library if you click on the thumbnail, then the resize, then it will show your original png. Maybe that is what is happening to you and why you think it's changing from jpg to png?

The thing is that it doesn't happen for all the images. Only the a few of them. Is it something sharepoint does in cases when the images are larger than a specific size?
–
Daniel ZigaMay 10 '12 at 12:20

SharePoint automatically creates two JPG images every time you upload image to a Picture Library: they are thumbnail image and web preview image. They're stored along with the original image in the Picture library.

No in-place conversion happens: the image is converted only once during the initial upload process.

You can retrieve your original image at any time, it has permanent server path and could be accessed directly for whatever you need.

Preview images size could be customized through Object Model (customization will affect only new images), you can set up ThumbnailSize, WebImageHeight and WebImageWidth properties of your document library for this purpose. Alternatively to programmatic approach, obviously you can use PowerShell. Here is a simple example:

Unfortunately, at the time of writing there is no way to influence upon the preview pictures quality. However, if you don't like this functionality, you can completely disable this feature, by setting ThumbnailsEnabled property to false.

The thing is that it doesn't happen for all the images. Only the a few of them. Is it something sharepoint does in cases when the images are larger than a specific size?
–
Daniel ZigaMay 10 '12 at 12:20

In my environment, this happens for all images, regardless of their size (I've just tested).
–
Andrey MarkeevMay 10 '12 at 12:36