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?
Borderlands 2 is free on Steam to grab right now by Pulasthi Ariyasinghe
The fourth installment in the main Borderlands series is only a few months away from launch, and now there's a good opportunity for new players to see what all the excitement is about. Developer Gearbox today launched a giveaway for Borderlands 2, offering the base game for all PC gamers to claim for free and play through its campaign. The promotion is running on Steam, making it an easy grab for most.
The 2012-released action RPG takes players to the lawless planet of Pandora for a humorous adventure concerning a rebel group going up against the fan-favorite tyrannical boss, Handsome Jack. Taking the role of Vault Hunters searching for a grand treasure on the planet, the characters Axton (Commando), Maya (Siren), Zer0 (Assassin), and Salvador (Gunzerker) are available to play in the base game.
Each Vault Hunter has their own skill trees and ultimate abilities, letting players mix and match many of their play styles when progressing through the campaign. However, perhaps the most important aspect of the Borderlands series is the guns. The looter shooter elements of the title mean that there are countless weapon and gear variations, each coming with unique stats and effects that vary depending on the rarity. Borderlands 2 supports up to 4-player cooperative play with drop-in, drop-out multiplayer. Your character's loadout and progression will follow you for any games you join as well.
The Borderlands 2 giveaway on Steam is live right now. It's slated to come to an end on June 8 at 10am PT. For those looking to expand on the Borderlands universe after grabbing the freebie, all the games and their massive number of DLCs are discounted as part of a franchise sale on Steam right now too.
Don't forget that PC players can also pick up Bethesda's Deathloop right now for free as well, with that promotion currently running on the Epic Games Store.
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