I used this code for converting tiff to png before:
using (MemoryStream inStream = new MemoryStream(tiffBytes))
{
using (MemoryStream outStream = new MemoryStream())
{
System.Drawing.Image.FromStream(inStream)
.Save(outStream, System.Drawing.Imaging.ImageFormat.Png);
}
}
and it worked very well for all tiff files with any size and dimension until I needed to change this code and converting TIFF filse to JPEG:
using (MemoryStream inStream = new MemoryStream(tiffBytes))
{
using (MemoryStream outStream = new MemoryStream())
{
System.Drawing.Image.FromStream(inStream)
.Save(outStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
But when I changed the code, I get a generic error for uploading big tiff size. like an image with 21 MB size. (there are no problems with little tiff size).
"A generic error occurred in GDI+."
What can I do? I have no limits on the size.