Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It works pretty much everywhere. None of the major OS’s trust the extension for images.


I want to caveat this a bit. The OS does trust the extension of any file (at least MacOS/Windows). If you change a .png to a .docx, the OS will launch the handler associated with .docx files. If you change a .png to a .jpg, the OS will launch the handler for .jpg files. Chances are that program is the same for .jpg as it would have been for .png. When that program launches, reads the file, it probably looks at the file signature and then appropriately parses the rest of the image data.

Arguably, the user has been trained to think that renaming between image format converts between the two because of the image processing program correctly parsing and displaying the image, rather than displaying a message that the user opened a .jpg file but it was really a .png.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: