Why do I have unwanted extra bytes at the beginning of image? Why do I have unwanted extra bytes at the beginning of image? nginx nginx

Why do I have unwanted extra bytes at the beginning of image?


This seems to be a bug involving Chuncked transfer encoding in

Class: System.Web.HttpResponse (or one of its dependencies)Method: TransmitFile(string filename)

Edit:
There is this code in the constructor:

if (worker_request != null)      use_chunked = (worker_request.GetHttpVersion () == "HTTP/1.1");

Patched it to check for CGI (if CGI, the server handles the file transfer, so there may be no chuncked encoding given back from the FastCGI server as per RFC 3875.

        internal HttpResponse (HttpWorkerRequest worker_request, HttpContext context) : this ()        {            WorkerRequest = worker_request;            this.context = context;#if !TARGET_J2EE            if (worker_request != null)            {                if(worker_request.GetHttpVersion () == "HTTP/1.1")                {                    string GatewayIface = context.Request.ServerVariables["GATEWAY_INTERFACE"];                    use_chunked = (GatewayIface == null || !GatewayIface.StartsWith("CGI"));                }                else                    use_chunked = false;            }#endif            writer = new HttpWriter (this);        }

Added patch to https://bugzilla.xamarin.com/show_bug.cgi?id=10001
Fixed in mono 3.2.3


31 39 36 62 36 38 0D 0A

is 196b68/r/n in ascii.

  • does this color some how related to your code?
  • does the string 196b68/r/n say something related to your platforms?


I don't recognize that Tools.Imaging.GetThumbnailStream() function, and neither does Google. Assuming that's your own code or a 3rd party library, I'd look there for the source of the strange bytestream.