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?
Around 68% of developers are now using AI to generate code during development, and some experts are saying that a single developer using AI tools can now do the work of an entire team of 4 to 5 engineers.
According to Figma's State of the Designer 2026 report, 72% of designers now use generative AI in their workflows and 91% say it improves the quality of their work, not just their speed.
But does this mean web developers and designers are becoming less relevant, or are they simply evolving into a different kind of role?
Would love to hear from developers and designers here has AI made your job easier, or do you feel threatened by how fast these tools are improving
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