I need to find the dimension of a REALLY BIG TIFF Image (It is a GEOTIFF MAP). I've tried using JAI or ImageIO but it resulted in mem overflow and some ARRAY SIZE LIMIT exception. But I don't really want to LOAD the entire TIFF. I just only want the dimension (Height and Width) of it.
I did my own research and the only piece of code i found that works is the following:
//can't read image format... what do you want to do about it,
//throw an exception, return ?
}
reader.setInput(imageStream,true,true);
int imageWidth = reader.getWidth(0);
int imageHeight = reader.getHeight(0);
reader.dispose();
imageStream.close();
Ok, here comes my problem. ImageReader is only available in Java 1.5 and above. UNFORTUNATELY... i am limited (means i cannot change this) to only using java 1.4.2_05. So i don't have ImageReader. So my question is if there is any other way i can read the image dimension?
Question
donchen
Hi Guys,
Hope someone can help me here.
I need to find the dimension of a REALLY BIG TIFF Image (It is a GEOTIFF MAP). I've tried using JAI or ImageIO but it resulted in mem overflow and some ARRAY SIZE LIMIT exception. But I don't really want to LOAD the entire TIFF. I just only want the dimension (Height and Width) of it.
I did my own research and the only piece of code i found that works is the following:
Ok, here comes my problem. ImageReader is only available in Java 1.5 and above. UNFORTUNATELY... i am limited (means i cannot change this) to only using java 1.4.2_05. So i don't have ImageReader. So my question is if there is any other way i can read the image dimension?
Regards
Don Chen
Link to comment
https://www.neowin.net/forum/topic/845162-java-getting-tiff-image-dimension-without-loading-image/Share on other sites
3 answers to this question
Recommended Posts