Hey Joe, Can you post your code? Are the images on the filesystem or held in a database etc?
Cheers, Tim On Jul 25, 7:28 pm, Joe Wass <j...@folktunefinder.com> wrote: > I'm completely stumped. I'll give the background for the sake of > completeness but I'm not sure if it will help or not. It's more of a > Jetty problem but perhaps someone here can help. > > Standard Jetty set-up running one Lift instance. Mac OS X. > > I have a snippet which transforms the XML input, renders an image, > saves it to disc under the webroot/images/ directory with a filename > taken from the MD5 of the contents, such as > "c5669d3eedcf7d305dcf9f88a61b3ee0.png" . The snippet then returns an > <img /> with a reference to the generated image for inclusion in the > output. > > Most of the time most of the images work. But most of the time some of > them don't, and some of the images are not rendered by the browser. > Attempting to view a problem image in the browser (Camino and Firefox) > doesn't work: the image is not displayed, suggesting that something is > vaguely wrong. Viewing it in another browser (Safari and with > QuickTime), the image works fine. When viewing the file directly with > Camino (i.e. file://...), the image shows fine (the file itself is not > corrupted). I can only assume that something goes wrong in the > transport of the image. > > The URIs that do fail, fail consistently, it's not intermittent. > Restarting Jetty makes no difference, so I don't think it's that the > file was created after the server started. Also, the render is a > blocking call, so there's no chance that the file is still open / > hasn't been saved before the HTML is sent and the browser requests the > images. > > The only thing I can imagine is that the MIME type is mangled, so I > put the appropriate mapping in web.xml: > > <mime-mapping> > <extension>png</extension> > <mime-type>image/png</mime-type> > </mime-mapping> > > But still no cigar. The MIME type looks to be OK and I've verified > that the number of bytes is correct. > > HTTP/1.1 200 OK > Expires: Thu, 01 Jan 1970 00:00:00 GMT > Set-Cookie: JSESSIONID=1dbeh8eq4mtu0;Path=/ > Content-Type: image/png > Content-Length: 25488 > Last-Modified: Sat, 25 Jul 2009 15:38:19 GMT > Server: Jetty(6.1.16) > > For completeness, the headers from an image that does load fine: > > HTTP/1.1 200 OK > Expires: Thu, 01 Jan 1970 00:00:00 GMT > Set-Cookie: JSESSIONID=15dt649lzovc4;Path=/ > Content-Type: image/png > Content-Length: 18657 > Last-Modified: Sat, 25 Jul 2009 15:41:35 GMT > Server: Jetty(6.1.16) > > Very very puzzled about this. Any clues? > > Cheers > > Joe --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---