Last post Jan 29, 2020 09:04 PM by mgebhard
Jan 29, 2020 08:11 PM|niranjanp|LINK
i have one use case, to convert byte array to image.How to do it. I have done some RND but getting error from below code.
public static bool IsValidImage(byte bytes)
using (MemoryStream ms = new MemoryStream(bytes))
Image image = Image.FromStream(ms);
catch (ArgumentException ex)
Please Suggest me
Jan 29, 2020 08:44 PM|mgebhard|LINK
You have not provided enough information to understand the whole problem. The code indicates you are checking if a byte array is an image. Is the byte array an actual image? If so, what process created the byte array? Are you reading n image from
disk, HTTP stream, database? The code shown hides the actual exception, inner exceptions, and stack trace. Can you tell us what the error is?
Jan 29, 2020 08:47 PM|niranjanp|LINK
Jan 29, 2020 08:49 PM|niranjanp|LINK
Jan 29, 2020 09:04 PM|mgebhard|LINK
I'm not going to beg you to tell us how your image processing works. Please debug your code. If you need community debugging support then provide enough code so any community member can reproduce the issue.
Perhaps, take a look at this, easily found, thread and see if it helps.