Image size is about 2.5 MB
This code gives me the correct size:
var fileLength = new FileInfo(path).Length;
This code gives me about 600KB
Image image= Image.FromFile(path);
byte[] imageByte = imageToByteArray(image);
long legnth= imageByte.Length;
public static byte[] imageToByteArray(System.Drawing.Image imageIn)
{
MemoryStream ms = new MemoryStream();
imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
return ms.ToArray();
}
What am I missing?
The problem is that I get the image in byte [], so ..
source
share