JavaFX: get the format (PNG, JPG ..) of an image?
2 answers
If you don't trust the filename, a simple check is to read the first 8 bytes (s FileInputStream
) and check if they match the PNG signature (related: fooobar.com/questions/1224133 / ... )
+2
source to share