Pergunta

I have installed mono 3.2.6 on CentOS 6.4. I need to create JPEG bitmap, but the following method does not return proper mime type:

ImageCodecInfo jpegImageCodecInfo = ImageCodecInfo.GetImageEncoders().FirstOrDefault(x => x.MimeType.Equals("image/jpeg"));

ImageCodecInfo.GetImageEncoders() returns only image/bmp and image/png. I already have installed libjpeg-turbo and libjpeg-turbo-devel with libjpeg-turbo-static, but with no effect. What could be the reason?

Foi útil?

Solução

Ok, finally we managed to solve the problem.

Problem was that libgdiplus could not find the proper version of libjpeg.so. The newest version of libjpeg.so provided with libjpeg-turbo was 62 while the required version is 90. Finally we used the newest version of libjpeg available at http://www.ijg.org/.

If you encounter similar problem you should first install proper (>=90) version of libjpeg.so then copy it to /usr/lib64/ and then recompile libgdiplus. That should fix it.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top