Home AMX User Forum AMX General Discussion

JPEG F I F ?

JPEG File Interchange Format? Has anyone ever attempted to send a jpeg image to a browser with the master set up as HTTP server?

I've made several half assed attemps with no luck. Basically hoping it would just work but it doesn't. I assume it has to be compressed in this standard but maybe if I download and write the jpeg image to flash then it will already be stored in this compressed format.

Browsers keep asking me for the GET /favicon.ico or the GET /apple.favicon.png or something. Of course that brings up a png format problem. Of course it also becomes an issue if I want to use image skins for button displayed on these browsers.

Any ideas, is it simply not worth the effort. I don't need them for web pages but since the browsers ask I figure I at least try and make them happy.

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    vining wrote: »
    Browsers keep asking me for the GET /favicon.ico or the GET /apple.favicon.png or something.
    favicon is the tiny icon that's to the immediate left of the URL address bar.
    If the browser can't GET one it displays a default icon.
    favicon is also used as part of the bookmak for that page.
  • viningvining Posts: 4,368
    Yeah I know all that but if I choose to supply my own what's the procedure? Also if I want image skins on buttons or even a background image and just use the file path relative to the server /some_image.png and not the entire http://URL/some_image.png how would I package the images.

    I've styled a header for images like this. This one obviously for a jpeg. The content length is the readfile returned length and after this header the data returned from my read file was the message body.
    STACK_VAR CHAR cWebHead[LEN_STR_MSG] ;
         
         cWebHead = "'HTTP/1.0 200 OK',CRLF,
         'Date: ',cWebCurDateTime,CRLF,
         'Server: AMX NetLinx',CRLF,
         'Last-Modified: Wed, 11 Feb 2009 09:05:55 EST',CRLF,
         'Cookie: JSESSIONID=',cWebCookie,CRLF,
         'Connection: keep-alive',CRLF,
         'Content-Type: image/jpeg',CRLF,
         'Content-Length: ',itoa(iLengthContent),  //no cr or lf after content length?
         CRLF,
         CRLF" ;
    
    

    Now in WireShark when a server sends an image this way it shows an HTTP response code like this:
    HTTP	HTTP/1.1 200 OK  (JPEG JFIF image)
    
    I'm thinking the appended (JPEG JFIF image) is just a quick reference for WireShark viewers since it's not part of a valid 200 OK response.

    After the header the content (message) shows JPEG File Interchange Format and a bunch of other stuff which again I assume are just what WireShark parses out for added viewer information. Basically a summary of the data content of the message body.
Sign In or Register to comment.