I had been serving the image from my own webapp’s database via a servlet, so I tweaked the code to instead set a fixed URL, which is also the image that for whatever reason, I cannot display from my database no matter how many times I upload it, whereas all other images are fine.
https://esignforms.com/NationalDebtAdjusters/images/nationaldebtLogo.gif
At any rate, in the ‘access log’ of the other web server, it is clear that is called twice (in this case, not using any of my Vaadin code to serve the image) – and of course the Link then opens a window and shows the image fine, without any error about it being invalid:
98.111.70.237 - - [28/Jan/2011:09:17:22 -0800]
“GET /NationalDebtAdjusters/images/nationaldebtLogo.gif HTTP/1.1” 200 15076 “http://localhost/open-eSignFormsVaadin/vaadin/” “Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13”
98.111.70.237 - - [28/Jan/2011:09:17:22 -0800]
“GET /NationalDebtAdjusters/images/nationaldebtLogo.gif HTTP/1.1” 200 15076 “-” “Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13”
When it’s not hacked, it goes to my servlet, and my breakpoint shows it’s being called twice. I also can see that after the first call’s response, the Link that opens the window and shows the image already has it shown, so the second call is not doing anything. The debug stack trace at the breakpoint in my servlet is identical for both calls, too.
But I have since found that this ONLY occurs with Firefox, and when I use IE8, Safari, Chrome or Opera, the image is only requested once. I don’t know what odd setting I have for FF that is causing this, or if all FF does this, but it is odd and is clearly not a Vaadin issue.
As for the invalid image file, I cannot figure it out, but I am pretty sure it’s not a Vaadin issue. I capture the file using the Upload component and store it “as is.” But I also pass it to a javax.swing.ImageIcon where I can then scale it for a thumbnail, and that code is the one that says the image is invalid. If I save the GIF as a JPEG using Paint Shop Pro, the JPEG can be used, but when I save it as a PNG, it gets the same invalid image error. The image is not particularly interesting (big or small or odd dimensions or anything), and most every other image works just fine. I’m guessing this is not a Vaadin issue either, but if I figure anything out, I’ll let the forum know.