Попытайтесь проверить с 7 zip . Это - открытый исходный код и моя программа zip fav. очень kewl. использует в своих интересах много ядра также.
SDK.NET доступен здесь .
try(ImageInputStream in = ImageIO.createImageInputStream(resourceFile)){
final Iterator<ImageReader> readers = ImageIO.getImageReaders(in);
if (readers.hasNext()) {
ImageReader reader = readers.next();
try {
reader.setInput(in);
return new Dimension(reader.getWidth(0), reader.getHeight(0));
} finally {
reader.dispose();
}
}
}
Спасибо sfussenegger за предложение
Using ImageReader.getHeight(int) and ImageReader.getWidth(int) normally only reads the image header (I'm looking at JDK6 sources). So ImageReader is most likely the best choice.
You'll have to look into ImageReader.getImageMetadata()
. Unfortunately, The Java Image API is not at all easy to use.
You can find descriptions of the metadata formats in the package documentation of javax.imageio.metadata
.
There are third party libraries that are easier to use, such as MediaUtil (last updated 3 years ago, but it worked well for me).