java - Check if a file is an image -
I am using JAI and am making a file on it:
Plain Image IMG = JAI ("File Load", MyFileName);
When the file exists, I check it before the line.
The image magnetic project has the ability to identify the image and there is a Java cover for the image magic , Which is called JMK, which I think you might want to consider instead of changing the wheel again:
I am using image magics all the time, It also includes its "detection" feature from the command line and it has failed to identify a photo.
It needed that feature completely and JMG had not yet existed, but I used to command Java code for Runtime.XAC ()
ImageMagick identity
And it used to work perfectly.
Nowadays, JMG has existed, perhaps it is not necessary now (but I have not tried JMGC yet).
Note That it just gives more than the format, for example:
$ Identification tmp3.jpg tmp3.jpg JPEG 1680x1050 1680x1050 + 0 + 0 Direct class 8-bit 293 $ 582kb $ detection tmp.png tmp.png PNG 1012x900 1012x900 + 0 + Direct class 8-bit 475.119kb
Comments
Post a Comment