private static isCompressed ( Stream imageData ) : bool | ||
imageData | Stream | |
return | bool |
private static bool isCompressed(Stream imageData)
{
if (imageData == null)
return false;
if (imageData.Length <= 2)
return false;
imageData.Seek(0, SeekOrigin.Begin);
int first = imageData.ReadByte();
int second = imageData.ReadByte();
return (first == 0xFF && second == (int)JPEG_MARKER.SOI);
}