Error:

Invalid SOI Marker detected in file.

Fix:

SOI = Start of Image Marker

If you are using FileStream to load in image file, make sure to reset the SOI position before you re-load the FileStream object.

fileStreams.Position = 0;

Image.Load(fileStreams) // Error if position not reset

Examples:

// Upload resized photo to Azure.
msImageNew.Position = 0;
await BlockBlob.UploadFromStreamAsync(msImageNew);

// Get new image properties.
msImageNew.Position = 0;
Image imgNew = Image.Load(msImageNew);
Last modified: March 28, 2021

Author

Comments

Write a Reply or Comment