How to find out image size (in pixels) of jpg and gif files

this seems to work, though i doubt that it would very time:
               Image img = Toolkit.getDefaultToolkit().getImage("car.jpg");
               int w = img.getWidth(null);
               int h = img.getHeight(null);
               while(w <= 0 || h <= 0)
                  try{Thread.sleep(10);}catch(InterruptedException ix){}
                  w = img.getWidth(null);
                  h = img.getHeight(null);
               JOptionPane.showMessageDialog
                  null,
                  filenames[i] + ": " + w + "x" + h,
                  "ImgSize",
                  JOptionPane.INFORMATION_MESSAGE
               );please suggest a better solution.
thanks

>
We've a requirement that we need to find out the size of a java object at run time, is there a direct java API to get the size of a composite object in memory?
Here is my requirement: We are adding string objects (which is an xml string of considerable size) into a List. After reaching certain size limit (lets say 5MB) of the list i need to put this data into DB as a CLOB. So every time I add a string object to the list, I need to see if the total size of the list exceeds the limit and if yes, flush the results into DB.
I am not sure if java has a direct API for this, if not what is the beast way to do it, it s critical requirement for us.
It would be really great if someone could help us out.
>
Could you explain your actual requirement a little more fully.
1. Is each individual string a separate XML string? Or is it just a fragment? Why would you just concatenate them together into a CLOB? That won't produce valid XML and it won't let you easily separate the pieces again later. So provide a simple example showing some strings and how you need to manipulate them.
2. Are you using these xml strings in Java at all? Or are you just loading them into the database?
For example if you are just loading them into the database you don't need to create a list. Just create a CLOB in Java and append each string to the CLOB. Before you append each one you can check to see if the new string will put you over your length limit. If it will then you write the CLOB to the database, empty the CLOB and start appending again to the new clob instance.
If you explain what you are really trying to do we might be able to suggest some better ways to do it.

Similar Messages

  • How to find out each Cell having Data or Not in Excel File by Using WDJ

    Hi Friends,
    I have one doubt on WDJ.
    I have to Upload Excel File. Click on Upload Button in Excel file Data will move to One Bapi. This is I was done. But my Requirement is if any empty Cell in Excel That File not uploaded it display one error message Please upload Correct Excel File
    How to find out each Cell having Data or Not in Excel File by Using WDJ. Please tell me.
    By Using this Code I have Upload Excel File
    InputStream text = null;
         int temp = 0;
         //wdComponentAPI.getMessageManager().reportSuccess("filePath Vijay:::");
         try
                   File file = new File(wdContext.currentContextElement().getResource().getResourceName().toString());     
    FileOutputStream op = new FileOutputStream(file);
                   if (wdContext.currentContextElement().getResource()!= null)
                          text = wdContext.currentContextElement().getResource().read(false);
                             while((temp=text.read())!= -1)
                                  op.write(temp);
                                  op.flush();
                                  op.close();
                                  path = file.getAbsolutePath();
                                  //wdComponentAPI.getMessageManager().reportSuccess("Path Name :::::"+path);
         catch(Exception ex)               
                   ex.printStackTrace();
    But my Requirement is If excel having any Empty Cell that excel file not uploaded.How to do this...
    Regards
    Vijay Kalluri

    Hi my friend
    I would like to share you some APACHE APi´s that i use when i have to read excel files in Web Dynpro.
    JAR = poi-3.2-FINAL-20081019.jar
    Some Example:
    POIFSFileSystem fs;
    HSSFWorkbook wb;
    HSSFSheet sheet;
    String myMexican_ValueFromExcelis = "";
    try {
             fs = new POIFSFileSystem(new FileInputStream();
             // and select the cell "y"
            cell = row.getCell( 0 );
            myMexican_ValueFromExcelis = cell.getCellValue();  
    }cach(Exception e){
    REgargds

  • How to find out the BI Publisher Version from the Excel output file

    Hi,
    Can any one tell me How to find out the BI Publisher Version from the Excel output file generated using BI publisher.

    Take a look at it in notepad or a text viewer... it's just a MIME/HTML file...
    Example:
    From: "Created by Oracle BI Publisher 10.1.3.4.0" <>
    Subject: Created by Oracle BI Publisher 10.1.3.4.

  • How to find out difference between IAS Oracle Home patches and 10.1.2 Oracl

    How to find out difference between IAS Oracle Home patches and 10.1.2 Oracle Home patches.
    I have read me document but i could not able to understand.
    Please help me

    user10721329 wrote:
    How to find out difference between IAS Oracle Home patches and 10.1.2 Oracle Home patches.
    I have read me document but i could not able to understand.
    Please help meWhat docoument you are referring to?
    If you source the application env file APPS<CONTEXT_NAME>.env file under $APPL_TOP directory then this will set ORACLE_HOME to 10.1.2
    If you source the application env file <CONTEXT_NAME>.env file under $INST_TOP/ora/10.1.3 directory then this will set ORACLE_HOME to 10.1.3
    Environment Settings
    http://docs.oracle.com/cd/E18727_01/doc.121/e12841/T120505T120509.htm#F_92659x3Ax20H1x20Head1x3Ax20Environmentx20Settings
    Thanks,
    Hussein

  • How to find out if Role is active or not and also delimited or not ?

    How to find out if Role is active or not and also delimited or not ?

    Hi,
    Basically this job is done by BASIS (Technical) Team.
    They can check whether role is active or not by using tcode "PFCG" by giving role name.
    Regards,
    Rameshwar

  • How to find out the size of files transferred over the SQL * Net?

    I am trying to test the Advanced Compress (AC) for 11g Data Guard. When the AC is turned on, the archived log files are supposed to be compressed on the primary database server and sent over SQL*Net, then decompressed on the standby db server. We will see the file sizes are the same on both primary and standby servers. I want to verify that the AC works by monitoring how much data are sent over SQL*Net. Per Oracle, AC uses 35% less of the bandwith. That means the size of the files transferred should be at least 65% of the original size.
    Is there a way to find out the size through Oracle utilities? If not, how to find out by OS utilities? OS is Solaris 5.10.
    Thanks.

    I'm not sure this can be done via SQL*Net, but a network packet sniffer between the two servers should be able to help - you might want to contact your network team.
    HTH
    Srini

  • Urgent: How to find out the size in bytes of java object

    Hi Experts,
    We've a requirement that we need to find out the size of a java object at run time, is there a direct java API to get the size of a composite object in memory?
    Here is my requirement: We are adding string objects (which is an xml string of considerable size) into a List. After reaching certain size limit (lets say 5MB) of the list i need to put this data into DB as a CLOB. So every time I add a string object to the list, I need to see if the total size of the list exceeds the limit and if yes, flush the results into DB.
    I am not sure if java has a direct API for this, if not what is the beast way to do it, it s critical requirement for us.
    It would be really great if someone could help us out.
    Thank you,
    -Shibu.

    >
    We've a requirement that we need to find out the size of a java object at run time, is there a direct java API to get the size of a composite object in memory?
    Here is my requirement: We are adding string objects (which is an xml string of considerable size) into a List. After reaching certain size limit (lets say 5MB) of the list i need to put this data into DB as a CLOB. So every time I add a string object to the list, I need to see if the total size of the list exceeds the limit and if yes, flush the results into DB.
    I am not sure if java has a direct API for this, if not what is the beast way to do it, it s critical requirement for us.
    It would be really great if someone could help us out.
    >
    Could you explain your actual requirement a little more fully.
    1. Is each individual string a separate XML string? Or is it just a fragment? Why would you just concatenate them together into a CLOB? That won't produce valid XML and it won't let you easily separate the pieces again later. So provide a simple example showing some strings and how you need to manipulate them.
    2. Are you using these xml strings in Java at all? Or are you just loading them into the database?
    For example if you are just loading them into the database you don't need to create a list. Just create a CLOB in Java and append each string to the CLOB. Before you append each one you can check to see if the new string will put you over your length limit. If it will then you write the CLOB to the database, empty the CLOB and start appending again to the new clob instance.
    If you explain what you are really trying to do we might be able to suggest some better ways to do it.

  • UITableView section header: How to find out font size and background color

    Hi, does anyone know how to find out the default font and default background color(or image?) used in the section header of a tableView
    I'd like to create a view with the same background color/image and use the same font (with different color) used by the section header

    I don't think there are any getter methods for a section header. But I wouldn't be surprised if the header was an object. You might try setting some header text to a key string and searching recursively through all the subviews for objects that respond to a text message. It might help to also print the description of objects that don't respond to text. I haven't tried this yet, but will let you know if I get any useful results.
    I guess another approach would be to use viewForHeaderInSection to set the font and color to whatever you wanted. Then you wouldn't have any problem matching it.

  • How to find out the size of a database?

    I'm not an oracle dba but a report developer. I'd like to find out the size of my database.
    Is this possible using simple query?

    An oracle database consists of data files, redo log files, control files, temporary files. Whenever you say the size of the database this actually means the summation of these files.
    select a.data_size+b.temp_size+c.redo_size+d.controlfile_size "total_size in MB"
    from
    ( select sum(bytes)/1024/1024 data_size from dba_data_files ) a,
    ( select nvl(sum(bytes),0)/1024/1024 temp_size from dba_temp_files ) b,
    ( select sum(bytes)/1024/1024 redo_size from sys.v_$log ) c,
    ( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024 controlfile_size from v$controlfile) d;
    here
    a is megabytes allocated to ALL datafiles
    b is megabytes allocated to ALL TEMP files
    c is megabytes allocated to ALL redo-logs
    d is megabytes allocated to ALL control files
    Nimish Garg
    Software Developer
    *(Oracle & ASP.NET)*
    Indiamart Intermesh Limited, Noida
    To Get Free Oracle & ASP.NET Code Snippets
    Follow: http://nimishgarg.blogspot.com

  • How to find out Cube Size (Step by step process)

    Hi all,
    Can any body tell me How can i find out the Cube size ?
    Thanks in advance.
    Vaibhav A.

    Hi,
    try Tcode DB02
    and
    A simplified estimation of disk space for the BW can be obtained by using the following formula:
    For each cube:
    Size in bytes =
    (n + 3) x 10 bytes + (m x 17 bytes) *
    http:// rows of initial load + rows of periodic load * no. of periods
    n = number of dimensions
    m = number of key figures
    For more details please read the following:
    Estimating an InfoCube
    When estimating the size of an InfoCube, tables like fact and dimension tables are considered.
    However, the size of the fact table is the most important, since in most cases it will be 80-90% of the
    total storage requirement for the InfoCube.
    When estimating the fact table size consider the effect of compression depending on how many
    records with identical dimension keys will be loaded.
    The amount of data stored in the PSA and ODS has a significant impact on the disk space required.
    If data is stored in the PSA beyond a simply temporary basis, it could be possible that more than 50%
    of total disk space will be allocated for this purpose.
    Dimension Tables
    u2022 Identify all dimension tables for this InfoCube.
    u2022 The size and number of records need to be estimated for a dimension table record. The size of
    one record can be calculated by summing the number of characteristics in the dimension table at
    10 bytes each. Also, add 10 bytes for the key of the dimension table.
    u2022 Estimate the number of records in the dimension table.
    u2022 Adjust the expected number of records in the dimension table by expected growth.
    u2022 Multiply the adjusted record count by the expected size of the dimension table record to obtain
    the estimated size of the dimension table.
    Fact Tables
    u2022 Count the number of key figures the table will contain, assuming a key figure requires 17 bytes.
    u2022 Every dimension table requires a foreign key in the fact table, so add 6 bytes for each key. Donu2018t
    forget the three standard dimensions.
    u2022 Estimate the number of records in the fact table.
    u2022 Adjust the expected number of records in the fact table by expected growth.
    u2022 Multiply the adjusted record count by the expected size of the fact table record to obtain the
    estimated size of the fact table.
    Regards,
    Marasa.

  • How to find out the size of the info cube.

    Hai,
          Could any one guide me to find the size of an infocube.
    Bye.

    Hi,
    check trasaction DB02 where u can find the cube size..
    check this..
    Re: Infocube size?
    Regards-
    MM
    Dont forget to assign points
    Message was edited by: vishnuC

  • How to find out amount of undo generated in 10g and 9i? for a given session

    Hi All,
    I am on v10.2 on Linux. How can I find out amount of undo generated in my session ?
    I tried this
    SQL&gt; select a.STATISTIC#, a.VALUE, b.NAME from v$mystat a , v$statname b
    2 where a.statistic# = b.statistic# and (b.name like '%undo%' or b.name like '%rollback%') ;
    STATISTIC# VALUE NAME
    5 0 user rollbacks
    75 0 DBWR undo block writes
    176 132 undo change vector size
    177 0 transaction tables consistent reads - undo records applied
    178 0 transaction tables consistent read rollbacks
    179 0 data blocks consistent reads - undo records applied
    182 0 rollbacks only - consistent read gets
    183 0 cleanouts and rollbacks - consistent read gets
    188 0 rollback changes - undo records applied
    189 0 transaction rollbacks
    200 0 auto extends on undo tablespace
    202 0 total number of undo segments dropped
    220 0 global undo segment hints helped
    221 0 global undo segment hints were stale
    222 0 local undo segment hints helped
    223 0 local undo segment hints were stale
    224 0 undo segment header was pinned
    226 0 SMON posted for undo segment recovery
    229 0 SMON posted for undo segment shrink
    236 0 IMU undo retention flush
    241 0 IMU CR rollbacks
    242 488 IMU undo allocation size
    22 rows selected.
    SQL&gt;
    SQL&gt; create table temp1 as select * from dba_objects where 1=2 ;
    Table created.
    SQL&gt; select a.STATISTIC#, a.VALUE, b.NAME from v$mystat a , v$statname b
    2 where a.statistic# = b.statistic# and (b.name like '%undo%' or b.name like '%rollback%') ;
    STATISTIC# VALUE NAME
    5 0 user rollbacks
    75 0 DBWR undo block writes
    176 30280 undo change vector size
    177 0 transaction tables consistent reads - undo records applied
    178 0 transaction tables consistent read rollbacks
    179 8 data blocks consistent reads - undo records applied
    182 8 rollbacks only - consistent read gets
    183 0 cleanouts and rollbacks - consistent read gets
    188 0 rollback changes - undo records applied
    189 0 transaction rollbacks
    200 0 auto extends on undo tablespace
    202 0 total number of undo segments dropped
    220 0 global undo segment hints helped
    221 0 global undo segment hints were stale
    222 0 local undo segment hints helped
    223 0 local undo segment hints were stale
    224 0 undo segment header was pinned
    226 0 SMON posted for undo segment recovery
    229 0 SMON posted for undo segment shrink
    236 0 IMU undo retention flush
    241 0 IMU CR rollbacks
    242 560 IMU undo allocation size
    22 rows selected.
    SQL&gt; insert /*+ APPEND */ into temp1 select * from dba_objects ;
    91057 rows created.
    SQL&gt; commit ;
    Commit complete.
    SQL&gt; select a.STATISTIC#, a.VALUE, b.NAME from v$mystat a , v$statname b
    2 where a.statistic# = b.statistic# and (b.name like '%undo%' or b.name like '%rollback%') ;
    STATISTIC# VALUE NAME
    5 0 user rollbacks
    75 0 DBWR undo block writes
    176 171356 undo change vector size
    177 0 transaction tables consistent reads - undo records applied
    178 0 transaction tables consistent read rollbacks
    179 166 data blocks consistent reads - undo records applied
    182 91 rollbacks only - consistent read gets
    183 0 cleanouts and rollbacks - consistent read gets
    188 0 rollback changes - undo records applied
    189 10 transaction rollbacks
    200 0 auto extends on undo tablespace
    202 0 total number of undo segments dropped
    220 0 global undo segment hints helped
    221 0 global undo segment hints were stale
    222 0 local undo segment hints helped
    223 0 local undo segment hints were stale
    224 0 undo segment header was pinned
    226 0 SMON posted for undo segment recovery
    229 0 SMON posted for undo segment shrink
    236 0 IMU undo retention flush
    241 0 IMU CR rollbacks
    242 1352 IMU undo allocation size
    22 rows selected.
    What exactly is "undo change vector size" ?
    Also, if I am on v 9.2, this ( undo change vector size ) stat name is not there. What can be used in v9.2 ?
    Thanks in advance.

    Hi..
    >
    SET LINESIZE 200
    COLUMN username FORMAT A15
    SELECT s.username,
    s.sid,
    s.serial#,
    t.used_ublk,
    t.used_urec,
    rs.segment_name,
    r.rssize,
    r.status
    FROM v$transaction t,
    v$session s,
    v$rollstat r,
    dba_rollback_segs rs
    WHERE s.saddr = t.ses_addr
    AND t.xidusn = r.usn
    AND rs.segment_id = t.xidusn
    ORDER BY t.used_ublk DESC;
    >
    HTH
    Anand

  • How to find out which version of OID, SSO, Portal, and Disco. to install?

    Hi,
    I just upgraded from 11.5.9 (DB 9.2.0.4) to 12.1.1 (DB 10.2.0.5) using Rapid Install Wizard.
    The 11i system did have Portal and Single Sign-On, and Discoverer 4i. How can I find out which version of these I can install and integrate with the new system? Do I need to install a separate Application Server?
    Thanks,
    Sinan

    Please see these docs.
    Integrating Oracle E-Business Suite Release 12 with Oracle Internet Directory and Oracle Single Sign-On [ID 376811.1]
    Oracle Application Server with Oracle E-Business Suite Release 12 FAQ [ID 415007.1]
    Using Discoverer 10.1.2 with Oracle E-Business Suite Release 12 [ID 373634.1]
    Using Discoverer 11.1.1 with Oracle E-Business Suite Release 12 [ID 1074326.1]
    How To Enable Single Sign On (SSO) For Discoverer 11g (11.1.1.x) [ID 879604.1]
    Thanks,
    Hussein

  • Lync 2013 - How to find out if the Full or the Delta address book file is being downloaded

    Hello
    We have had various issues since upgrade to Lync 2013, specifically, Lync 2013 address book generation and download (bandwidth usage impact).
    I was wondering if there is a way to find out which version of AB is downloaded; FULL AB or the Delta file ?
    Thanks for your assistance,
    Luca

    Full address book contains a large set of user and contact object attributes.
    Delta files contain incremental updates.
    If a client is accessing the URL for the first time and successfully connects, the client attempts to download the current full data file. On subsequent days, the client attempts to download
    a delta file based on the last full synchronization date.
    Open Lync Configuration Information, check the ABS Server URLs, you can determine where the address book information comes from.
    Lisa Zheng
    TechNet Community Support

  • How to find out the size of a node before it is shown?

    Hi,
    I am trying to anchor two nodes (say A & B) to the top of an anchor pane such that B is laid out below A. To accomplish this, I need to provide an anchor offset for the control B, which has to be height of the node A. However, as the containing Stage has not been shown yet, the A's node getWidth() method returns 0 (zero). Since, node A's size is computed based on its contents, I can't hardcode its size. So, I am at a loss how to provide the height of the node A in a dynamic manner.
    Please feel free to ask me to clarify the question if I didn't make myself clear enough.
    Thanks.

    If one of the existing layouts doesn't work for you, then you can create your own. A little bit harder to do, but this would be your best bet since there is no trickery involved. Basically, all you have to do is override the layoutChildren() and the computePrefXXX (and, perhaps computeMinXXX) methods from Parent.
    Here is any overly simplified example that lays out three circles like a traffic light:
        @Override
        public void start(final Stage stage) {
            Parent parent = new Parent() {
                    getChildren().addAll(
                        CircleBuilder.create().fill(Color.RED).radius(20).build(),
                        CircleBuilder.create().fill(Color.YELLOW).radius(20).build(),
                        CircleBuilder.create().fill(Color.GREEN).radius(20).build()
                @Override protected void layoutChildren() {
                    double dx = 0;
                    double dy = 0;
                    for(int n=0, nMax=getChildren().size(); n<nMax; n++) {
                        Node child = getChildren().get(n);                   
                        double prefHeight = child.prefHeight(-1);
                        dy = prefHeight * n + prefHeight / 2;
                        child.setLayoutY(dy);
                        dx = child.prefWidth(-1) / 2;
                        child.setLayoutX(dx);
                @Override
                protected double computePrefHeight(double width) {
                    double prefHeight = 0;
                    for(Node child : getChildren()) {
                        prefHeight += child.prefHeight(width);
                    return prefHeight;
                @Override
                protected double computePrefWidth(double height) {
                    return getChildren().get(0).prefWidth(height);
            Scene scene = new Scene(parent);
            stage.setScene(scene);
            stage.show();
        }

Maybe you are looking for

  • Windows vista ultimate 64 bit PDF export error

    Hi there, I'm using diadem 11.0 and  i have a big problem with my new os. When i try to export a report in pdf i get a print error in the status of the "diadem pdf export" printer. Any idea or solution for fix this problem ? Solved! Go to Solution.

  • Add extra Business Objects to model CRM 2007: Web Client Records

    Hello, Could anyone tell me how I can add more Reference Objects in Case Management? I copied the model CRM 2007: Web Client Records and added a new node (with for example Business Object Service Order) just like product and installations (which are

  • Rsync used STRICTLY for "photos and video" library back-up

    Hi, I'm hoping to get some guidance from some experienced users of rsync. I'm new to rsync, but have been learning about it.   I'm also new to Terminal. .....**For full system back-ups, I use CCC (Carbon Copy Cloner)....clean and simple.** However, f

  • How to create tables in Database when webdynpro project is deployed

    Hi I Created a project.in that i created stuctures using simpletypes.Based on structure  i created the Context,then created screens.Now how to create tables in database using this structures .Because i want to store the values in the database.Please

  • Macbook Pro not printing to Windows network printer

    Hello, Recently purchased Macbook Pro Mac OS 10.7.2 Lion and I am unable to print to a windows network printer. When I click the print button nothing happens. I have tried to print from Safari, Word, Excel etc and nothing happens. The printer is adde