3 ms·
view source shows that he has an html document embedded in the jpeg. Apparently, the jpeg format allows this.
by younata 14y ago
view source shows that he has an html document embedded in the jpeg.
Apparently, the jpeg format allows this.
- pgeorgi 14y agoJPEG allows for additional data chunks (that's how thumbnails, EXIF data, ... are added). The HTML uses CSS to hide the "body" (since that would include the JPEG header), putting the real content in a container element that poses as new root. Neat hack.
- agwa 14y agoThe HTML document is in the "comment" field of the JPEG, which is perfectly reasonable. What is surprising is that web browsers just ignore the 24 bytes of binary data between the start of the file and the start of the HTML.
- ejdyksen 14y agoThat extra binary data starts with an HTML comment tag (<!--) which is never closed, so it makes sense that it is ignored. Edit: Misread your comment...the bytes at the beginning of the file are hidden by CSS (as pointed out by others).
- shuzchen 14y agoCommenter is referring to the binary data at the beginning of the file, which makes up the file header for the jpeg. It is before the <html> tag and is neither commented out or actually ignored. The browser actually picks that "text" up and shows it on page. It's just the html content itself contains some css rule to make that text not visible.
- dunham 14y agoIt's interpreting that data as "text" and sticking it at the beginning of the <body> of the document. The css makes the body invisible so you don't see it on the screen (unless you disable that rule) - take a look in the DOM inspector.
- jack-r-abbit 14y agoAs pointed out by someone else, the browser has been instructed via CSS to hide the body. If you inspect the page and manipulate the CSS to show the body, those odd bytes (ÿØÿàJFIF,,ÿþr) do get rendered.