I fight picurle. These are my headers:
headers.append('User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0')
headers.append('Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
headers.append('Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3')
headers.append('Accept-Encoding: gzip, deflate')
headers.append('Accept-Charset: UTF-8,*')
headers.append('Connection: Keep-Alive')
Original: 
What I get: 
As you can see, the one I get with pycurl is broken. If I compare them with a text comparison tool, it tells me that they are the same. (There was a difference in the outline of the lines where the original had only LF, and the broken one had CRLF, but I changed this and now I have identical images still broken)
The host I'm loading from is not the reason. I tried to do the same from dropbox and local apache. Both did not work.
This is how I save the image:
self.buffer = StringIO.StringIO()
self.curl.setopt(pycurl.WRITEFUNCTION, self.buffer.write)
f = open("temp/resources/%s" % (filename,), 'w')
f.write(self.buffer.getvalue())
f.close()
I would be glad if anyone has any suggestions on this, so I can find my mistake.
Hurix source
share