Errors uploading certain image file types - PNG & GIF
Every time I try to upload either a PNG or GIF to our Sitefinity 5.4 website I get the errors "A generic error occurred in GDI+" for PNGs and "Parameter is not valid" for GIFs.
I've tried changing the image size and the resolution; removing transparency; uploading to different image libraries; uploading as draft first, but nothing works. I can upload the images as JPGs, but this isn't much good to us as a lot of our images have transparent backgrounds.
Has anyone else experienced this problem and, more importantly, is there a cause and resolution?
Cheers.
Hi Neil,
The .gif and .png formats are supported by default. You can get a full list of the supported formats ( and add your own if you want ) from Settings -> Advanced -> Libraries -> Images ( you can check the attached image ).
Regards,
Ivan D. Dimitrov
Telerik
Thanks, although I forgot to mention that I'd already checked this and both .gif and .png are already there.
What else could be causing these errors?
Thanks,
Neil
Hi Neil,
The only other reason for this behavior is a bug in our system that causes the image extensions to be case sensitive. You can view the bug's description in our Portal. The only available fix for the moment is to make sure all your extensions are lower case.
We apologize for any inconvenience caused.
Regards,
Ivan D. Dimitrov
Telerik
Hi Ivan,
Lower case file extensions, or any case for that matter, don't work either. I even tried creating my own module that I could use to upload images, but I still get the same error for .png and .gif files.
Neil
Hello Neil,
This is indeed strange and definitely not default behavior. I doubt someone else has encountered the same issue. In order to reach a solution I would recommend you send a support ticket regarding this where a support officer can address this issue in depth.
Regards,
Ivan D. Dimitrov
Telerik
Hi Neil,
Did you submit a ticket for this issue? If so, what was the resolution?
I ask because I'm having a similar problem, but it's intermittent. In short, I'm importing blog entries from a WP blog into SF using the WP feed which contains all of the content as well as the images. I've tried every thing I can think of, from passing the stream directly into the LibrariesManager Upload method, to "using" the stream with my web client's OpenRead method and passing that in, ensuring the library allow for these particular image formats, running VS as an admin, changing the permissions on the containing folder, etc.
Any feedback would be much appreciated. Mahalo.
Hi Trevor,
I did submit a ticket and got this reply:
"After some research it seems that this issue has been seen before in earlier versions of Sitefinity. An easy way to overcome it consist on upgrading the project. We were able to upgrade your project locally to the version 6.0.4210 following the instructions described in our online documentation and that fixed the problem as you can see on this video."
We're on version 7.3 now and haven't had this problem since upgrading.
Neil
Thanks Neil. I doubt the root cause of my issue is the same as yours as I've never installed a version lower than 7.1 or 7.2. The installation I'm experiencing this on is running 8.2 so unless this bug was re-introduced in later versions, it may be something wrong with my approach. I'm going to try writing the stream to a file on disk then read it back as a stream and try to programmatically upload that to the CMS.
Anyways, thanks again!