You did not say, but suppose this is an HTTP connection.
In short, they do this to save bandwidth. 3G is not free!
If you directly request resources (GET), then you are at the mercy of all intermediaries that process the HTTP response (i.e. proxies, gateways), and you can be sure that they can see the MIME type in the headers and behave accordingly .
You can try using the HTTP Accept
header in your request and use the q
parameter as a "hint" so that you have maximum accuracy.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Accept: image/png;q=1
q
is between 0 and 1. You can leave with a lower value (than 1). Please read the related section for more details.
You can also check the incoming Content-Type
header; it can show if there is a “claimed” change in quality or even a MIME type. This can tell you what he did!
It would be great if the "standard" did its job for you!
If this does not work, and you already control the end of the server, use an alternative text encoding for it, such as Base64, which intermediaries cannot compress for you. SOAP has been doing this since!
If you really need to bypass image compression, and Accept
does not work, you should proxy these types of requests yourself and re-encode them with the MIME type without an image in the response.
If you go on a self-proxy route, you can probably get away with your application/octect-stream
images, which is the MIME type for “uninterpreted bytes”. This would allow more or less to transfer data and, hopefully, keep intermediaries "helping hands" from your things!