in line...<br><br>
<div class="gmail_quote">On Sat, Oct 17, 2009 at 11:33 AM, Carsten Haese <span dir="ltr"><<a href="mailto:carsten.haese@gmail.com">carsten.haese@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">Victor Subervi wrote:<br>> Let me clarify. This prints out "all sorts of crap", which means an<br>> image string, the image as a string, to the screen:<br>><br>> print 'Content-type: image/jpeg'<br>
> print 'Content-Encoding: base64'<br>> print<br>> print pic().encode('base64')<br>> print '</body></html>'<br><br></div>This has no hope of working, since you're sending data that's not valid<br>
base64 code and pretend that it's base64-encoded. A browser trying to<br>display this result will produce something anywhere between<br>unpredictable and garbage.<br></blockquote>
<div> </div>
<div>This was recommended to me previously on this list, so I tried it.</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im"><br>> The following once upon a time printed images, but now it doesn't. Why<br>> would that be? I would refresh the screen, and it would print. I'd<br>> change a line and it wouldn't. I'd change it back to what it was and it<br>
> would no longer the image to the screen. Why is that? The same happens<br>> with or without the base64 stuff. Commenting out a line seemed to make a<br>> difference!<br><br></div>Why would turning a comment into a statement NOT make a difference?!?<br>
</blockquote>
<div> </div>
<div>You misunderstood. Leaving in the __commented__ line __commented__ and __not__uncommented__ made a difference. Why?</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im"><br>><br>> print 'Content-type: text/plain'<br>> #print 'Content-type: image/jpeg'<br>> print<br>> print pic()<br>> print '</body></html>'<br><br></div>
This should produce plain text, not an image.<br>
<div class="im"><br>> The above prints out a broken image of correct dimensions.<br><br></div>What the heck is a "broken image of correct dimensions"? </blockquote>
<div> </div>
<div><a href="http://allpointsmarinevi.com/stxresort/cart/getpic1.py">http://allpointsmarinevi.com/stxresort/cart/getpic1.py</a></div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Are you looking<br>at the output of the script itself, or are you looking at an html page<br>that uses this script as src-attribute for an img-tag? In the latter<br>
case, if you're also giving the img-tag width and height attributes, it<br>shouldn't be surprising that you're getting the correct dimensions, and<br>you're getting a broken image because your src is producing plain text<br>
instead of an image.<br></blockquote>
<div> </div>
<div>Before, when it produced plain text it printed the same to screen. Now it does not.</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im"><br>> Of course I try and figure out how things work once they get working.<br>> Sometimes, however, there is __no__ logic to it __at__all__. Sorry.<br>> After years of struggling with python I've come to realize that even<br>
> though I may not be a good programmer, it isn't me. It may not be python<br>> itself. It may be the crappy hardware the server farms use. It may be<br>> the way they tweak their python interpreter. But it isn't just me.<br>
<br></div>I suppose it's possible that there is something quirky about the way the<br>server has been set up, but so far, the more likely explanation is that<br>you don't really know what you're doing.<br></blockquote>

<div> </div>
<div>Well, if I did, I wouldn't be asking for your help. I was hoping you could help me.</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>You can prove whether it's your server farm or you by running the same<br>code on a different server.<br>
</blockquote>
<div> </div>
<div>Which one?</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im"><br>> It would be nice if I could get this code printing images to the screen<br>> as it was before I had to put out another unnecessary fire when code<br>> that previously uploaded the images in the first place inexplicably no<br>
> longer worked. Then, lo and behold, when I came back to this code that I<br>> hadn't touched and was working fine earlier this week, it no longer<br>> works. Lovely. My "plug-and-play" program has devoured two weeks of my<br>
> time and I'm still up the creek without a paddle. Sure would appreciate<br>> any help you can give.<br><br></div>Again, you have to help us help you. I have listed the three things you<br>need to post together, and you haven't done that. You're giving us bits<br>
and pieces, but nothing that's sufficiently cohesive to do any<br>meaningful troubleshooting on.<br></blockquote>
<div> </div>
<div>Forgive me. I must have misunderstood. I have deleted the old message. Would you be so kind as to re-post those three things you need me to provide you?</div>
<div>TIA,</div>
<div>V</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div></div>
<div class="h5"><br>--<br>Carsten Haese<br><a href="http://informixdb.sourceforge.net/" target="_blank">http://informixdb.sourceforge.net</a><br><br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>