[Image-SIG] Using PIL to display resized images over the web

Chris Cogdon chris at cogdon.org
Wed Oct 8 20:06:12 EDT 2003


On Wednesday, Oct 8, 2003, at 16:58 US/Pacific, Steven M. Castellotti 
wrote:

> print file_out.read()

I suggest using:

sys.stdout.write ( file_out.read() )

Using print will add an unnecessary (and possibly harmful) CR-LF pair 
to the end of the image. Especially since you're relying on the web 
server to calculate the Content-Length from the data presented in the 
stream.


-- 
    ("`-/")_.-'"``-._        Chris Cogdon <chris at cogdon.org>
     . . `; -._    )-;-,_`)
    (v_,)'  _  )`-.\  ``-'
   _.- _..-_/ / ((.'
((,.-'   ((,/   fL




More information about the Image-SIG mailing list