How many ways are there to get the Width/Height of an image ?

I am currently using the following code to get the width and hight of an image :
BufferedImage Buffered_Image=ImageIO.read(new File(Image_Path));
int Image_Width=Buffered_Image.getWidth();
int Image_Height=Buffered_Image.getHeight();I don't need to get the image (*.jpg, *.gif, *.png), just want to know it's dimensions. I wonder how many other ways are available to do the same thing in a Java application ?
Frank

Ni_Min wrote:
That's what I thought. I am asking because I hit a wall and am trying to find a different approach.Yeah, if you only have one file type you can probably write the code to read the header in 20 min.
I packed my programs into an executable Jar file which I can run and access images on my C:\ drive, everything worked fine until I tried to experiment with something new. I know that I can force JVM to pre-load all my java classes just after it starts, so I deleted the jar right after the program pre-loaded all my classes and tried to see if it would work, but now I get a null pointer error when it tried to get the width/height of an existing image, because ImageIO.read return null. ( The same image is still on my C:\ drive )Sounds like a strange thing you're doing here. What's the point of this?
So I wonder why it makes a difference after I deleted the jar, what was the problem ( or do I need to pre-load another class related to ImageIO.read ? ), and maybe if I use something else other than the ImageIO.read to get the width/height, I can bypass the problem.I dunno why you need to do this preload stuff and/or delete anything. I'd say leave the JVM and the app alone if possible.

Similar Messages

  • HT4859 How many ways are there to get to Setup Assistant?

    I'd like to restore all the iPads we have in the classroom to a set configuration before each class.  Originally, the iCloud backup sounded like it would do the trick, however, from what I've been able to learn so far, iCloud backup behaves more like Recovery from Fatal error than either the Time Machine available on Macs and Deep Freeze, which is what we use for our Windows system.
    iCloud makes it easy to backup, why don't they give us an easy way to restore one of the backups?  As far as I can tell, if I want to restore from an iCloud backup, I have to use the Erase All Content and Settings in the Reset area of the General Settings option. Am I missing something are is this "solution" really that poorly designed?

    Ni_Min wrote:
    That's what I thought. I am asking because I hit a wall and am trying to find a different approach.Yeah, if you only have one file type you can probably write the code to read the header in 20 min.
    I packed my programs into an executable Jar file which I can run and access images on my C:\ drive, everything worked fine until I tried to experiment with something new. I know that I can force JVM to pre-load all my java classes just after it starts, so I deleted the jar right after the program pre-loaded all my classes and tried to see if it would work, but now I get a null pointer error when it tried to get the width/height of an existing image, because ImageIO.read return null. ( The same image is still on my C:\ drive )Sounds like a strange thing you're doing here. What's the point of this?
    So I wonder why it makes a difference after I deleted the jar, what was the problem ( or do I need to pre-load another class related to ImageIO.read ? ), and maybe if I use something else other than the ImageIO.read to get the width/height, I can bypass the problem.I dunno why you need to do this preload stuff and/or delete anything. I'd say leave the JVM and the app alone if possible.

  • How many WAYS are there to CREATE an OBJECT?

    I simply know about implicit creation and explicit creation:
    String name = "Asim Munir"; //Implicit
    String name = new String("Asim Munir"); // Explicit
    Do you have any other way to create an object?

    Hi,
    Basically in Java, an object is created by using the new keyword. This is the actual object creation. So far String is concerned, there is a trick what you have mentioned.
    Plz go through it.
    String str = "India"; It is also String object. But internally, Java maintains a String Constant pool to maintain the String object. When you are writing the above statement, it will first check the value "India" in the String Constant pool and it it does not find, then it will create an object. If it finds, it will not create but simply it maintain a reference to that "India" object. So here only one object is created. But in the following case.
    String str = new String("India");
    Here two objects are created. Just try to understand how two objects are created. If you have any problem, feel free to mail
    Debadatta Mishra
    [email protected]

  • How can I print the tutors for numbers app, and how many pgs are there

    can I print out a hard copy of tutor for numbers that I have purchased. If so about how many pgs are there-thks

    Ask the Tutor for Numbers app developer >  Contact Us - Noteboom Productions

  • How many apps are now offically in the appstore

    I want to know how many apps are there because I keep getting asked by my friends who are interested. Are there any companies that do any recent polls. I only know about back in October we where somewhere in the 300,000 mark.

    317,266

  • How many ways r there to implement Oss note

    how many ways r there to implement Oss note and please explain all...

    I count three.
    SNOTE is the first, which applies the note without needing to manually apply the code.
    Some notes can't be applied in SNOTE (the changes needed cannot be applied automatically by the system), so these are applied manually, following the instructoins in the note.
    A third way is to apply a support pack, which is essentially made up of a large number of notes.
    Regards,
    Nick

  • How many screens are there in module pool

    hi gurus
    can anyone suggest me
    how many screens are there in module pool
    thank you
    regards
    kals.

    see this link for better understanding of dialog programming/module pool programming.
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9ce935c111d1829f0000e829fbfe/content.htm
    see this
    Check the below link:
    http://wiki.ittoolbox.com/index.php/FAQ:What_is_module_pool_program_in_abap%3F
    http://help.sap.com/saphelp_46c/helpdata/en/35/26b1aaafab52b9e10000009b38f974/content.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
    http://www.geocities.com/ZSAPcHAT
    http://www.allsaplinks.com/files/using_table_in_screen.pdf
    http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
    http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
    http://www.sap-img.com/
    http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm
    http://www.sapgenie.com/links/abap.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm
    You can also check the transaction ABAPDOCU which gives you lot of sample programs.
    Also you can see the below examples...
    Go to se38 and give demodynpro and press F4.
    YOu will get a list of demo module pool programs.
    One more T-Code is ABAPDOCU.
    YOu can find more examples there.
    See the prgrams:
    DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
    DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
    http://www.geocities.com/ZSAPcHAT
    http://www.allsaplinks.com/files/using_table_in_screen.pdf
    Regards.
    Chandru

  • How many softwares are there to create a setup file for java programs

    Hi, i am new to java
    I want to know how many softwares are there to create a setup file for java programs.
    I know one software i.e java launcher to create a setup file.
    I want to know about any other softwares are available to create a setup file for java programs.
    I created a setup file for swings program in JCreator.
    And don't think that i am wastiing ur time with this question .
    Help me regarding this topic.
    Thanks in Advance

    superstar wrote:
    I want to know how many softwares are there to create a setup file for java programs.13, no wait, 42.
    I know one software i.e java launcher to create a setup file.You should clearly identify what you think you already know.
    I want to know about any other softwares are available to create a setup file for java programs.
    I created a setup file for swings program in JCreator.Is this the one you talked before, or is this different?
    And don't think that i am wasting ur time with this question .Why should I not think that?

  • How many states are there in a second?

    Hi
    I have to make an animation in fireworks and I am working in seconds.
    I can't work out how many states are there in a second.
    Please help.
    Thanks in advance.

    Not really sure what you are asking. If it is the speed of playback then go to the States panel and to the right is a number. Click it. It says 7/100 sec delay. Change this to alter playback speed. It's been ages since I've done animation in Fireworks

  • How to calculate how many calls are there in Queue

    Hi All,
    I have a requirement of calculating how many calls are there in queue at a particular moment, as the client wants to drop all the calls if there are 5 calls waiting in the queue.
    I am using ICM 8.0
    Any help would be great.
    Thanks

    Hi David,
    I am trying to crete a IF condition with CallType.callsqnow property, however callsqnow is not coming up in the list for calltype properties.
    But under Skillgroup's property list, there is a pooperty "callsqueuednow".  I am trying with this property, let's see if it works.
    However could you please advice why i am not seeing callsqnow property under call type?
    What i am doing is
         under if formula, select "call type" -> select name of the call type -> list of properties
    I am using ICM version 8.0.3.0

  • How many wagetypes are there

    How many wagetypes are there.
    Thanks In advance

    Dear,
    We have 3 types of WTs
    Primary wage type
    Secondary wage type
    Technical wage type
    Please refer this link for details,
    [ Wage Type |http://www.sap-img.com/hr019.htm]
    Regards,
    R.Brahmankar

  • How many iPhones are there to date?

    and how many iPhones will there be in the future?

    1: http://en.wikipedia.org/wiki/List_of_iOS_devices#iPhone
    2: Unknown

  • How do I find out how many fans are there in a router with the help of CLI? Specifically cisco3845 with ios c3845-spservicesk9-mz.124-3b.bin

           I have an issue where show env o/p is as below, I suspect the FAN 1 which shows failed is not present in router, how do i find out with the help of CLI , how many fans are present in router.
    #show environment all
    SYS PS1 is present.
           Fan status: Normal
           Input Voltage status: Normal
           DC Output Voltage status: Normal
           Type: AC
           Thermal status: Normal
    SYS PS2 is present.
           Fan status: Normal
           Input Voltage status: Normal
           DC Output Voltage status: Normal
           Type: AC
           Thermal status: Normal
    AUX(-48V) PS1 is absent.
    AUX(-48V) PS2 is absent.
    Fan 1 Failed
    Fan 2 Normal
    Fan 3 Normal
    Fan Speed is Normal
    Alert settings:
    Intake temperature warning: Enabled, Threshold: 55 Core temperature warning: Enabled, Threshold: 70 (CPU: 90)
    Board Temperature: Normal
    Internal-ambient temperature = 28, Normal CPU temperature = 41, Normal Intake temperature = 22, Normal Backplane temperature = 19, Normal
    Voltage 1(3300) is Normal, Current voltage = 3284 mV Voltage 2(5150) is Normal, Current voltage = 5153 mV Voltage 3(2500) is Normal, Current voltage = 2525 mV Voltage 4(1200) is Normal, Current voltage = 1203 mV
    Nominal frequency

    This means that FAN1 has failed.
    Fan 1 Failed
    Feb 14 07:31:01.996 GMT: %FAN-3-FAN_FAILED: Fan 1 had a rotation error reported.
    Feb 14 07:31:21.996 GMT: %FAN-3-FAN_FAILED: Fan 1 had a rotation error reported.
    Feb 14 07:31:41.995 GMT: %FAN-3-FAN_FAILED: Fan 1 had a rotation error reported.
    Feb 14 07:32:01.994 GMT: %FAN-3-FAN_FAILED: Fan 1 had a rotation error reported. Feb 14 07:31:01.996 GMT: %FAN-3-FAN_FAILED: Fan 1 had a rotation error reported.
    Feb 14 07:31:21.996 GMT: %FAN-3-FAN_FAILED: Fan 1 had a rotation error reported.
    Feb 14 07:31:41.995 GMT: %FAN-3-FAN_FAILED: Fan 1 had a rotation error reported.
    Feb 14 07:32:01.994 GMT: %FAN-3-FAN_FAILED: Fan 1 had a rotation error reported.

  • How many people are there in the Creator team?

    Can it be made available that how many people are working for deveolping this IDE? How many softwate engineers and developers? How many managers?
    thanks.

    No, we can't give you that level of detail. Resource staffing at Sun, like most companies, is strictly company confidential information.

  • How many documents are there in this Package?

    Is there an easy way to determine how many documents are in an existing Package?
    At the moment I work around it by using Search on a character pretty much guaranteed to be in them all, but I'd expect it to be a property stored somewhere?
    Acrobat Pro v8.1.2

    Apple in a press release from 2012 claimed more than 45,000 movies, but did not provide any details as to that figure. And it changes rapidly, and it would be different for each country, so unless someone went in and counted them manually in your country's iTunes Store, there won't be an accurate figure available.
    Regards.

Maybe you are looking for

  • Lagged Database Copy - help.

    Hi exchange gurus! I am working on testing LAgged DB copy in Exchange 2013. What I've done: 1. Configured lagged passive copy by running set-mailboxdatabasecopy .... -replaylagtime 2 (similar to what we have on transport), I didn't use -truncate opti

  • Mac Book not charging

    My brand new Mac Book does not appear to be charging. The light on the power cord shows "green" but the battery icon in the top bar shows the power source as "battery", not "power adapter" and only 26% remaining. When the unit is off and closed, the

  • I can't connect to itunes store please help

    Everytime when i want to buy an app i see "wairing" but it won't load. After 15 min it reports that i can't connect to itunes store.. Please help

  • 6.0.1 upgrade disabled iTunesU library

    The  6.0.1 upgrade disabled the my iPod Touch iTunesU library. The library "bookshelf" opens fine, and individual course lectures appear, but when I tap on a lecture, the whole library closes and the screen goes back to home screen, the one that show

  • Assigning Batch search strategy to material-batch key

    I am facing one strange problem. I am creating process order in COR1 for my finished goods FIN1. I have maintained BOM for FIN1 & assigned Semi finished goods SEM1, SEM2 as a BOM component. I have maintained enough stock of SEM1in batches. Now i am r