How can I get the resolution of an image file in JSP?

how can I get the resolution of an image file like jpg,gif,png in JSP ?

Hii,
If by the resolution, u mean size..this is how u can come to know....
String add = "path/to/some.jpeg";
javax.swing.ImageIcon chain = new javax.swing.ImageIcon(add);
int height = chain.getIconHeight();
int width = chain.getIconWidth();
Hope that helps.
regards
               

Similar Messages

  • How can I get the path of an existing file????

    Hi.
    I'm a newbie in Jsp development, so this question may appear trivial.
    How can I get the path into a String of an exixting file ..like ...
    String thepath = path_of("my file.txt");
    Thanks for your help.

    Try
    application.getRealPath("myFile.txt")

  • Terminal how can i get the picture dimension of a file?

    Is it possible to get the dimension of an picture (120 x 120 px) via terminal command? The information is visible under the finder "getinfo" command for picture files. Can anyone help?

    You can get image pixel size info using the ImageMagick utilities, which is a GNU package available for installation via the fink pacakage manager, then you can use the terminal command:
    identify image.gif
    ImageMagick also has several other useful conversion and image processing utilities.
    http://www.finkproject.org/
    http://www.imagemagick.org/script/index.php
    Good luck.
    P.S. - There may be ways to interact with AppleScript from Terminal to get the Finder info from a file, but I don't know how to do that.

  • How can i get the column names in CSV file.

    Hi,
    After execution of infospoke i can not see the column names in that file.How can i get column of respective infoprovider?
    Thanks,
    Gananadha Lenka

    Hello Gana,
    Actually while exporting the data using Info Spoke, we have the possibility to modify the data that we send. This is possible using transformations.
    In your Info Spoke, you have a tab called Transformations.
    Here you need to create an implementation and then use BADi to populate data.
    Check if you can write a start routine sort of thing here and insert a new record into the internal table by hardcoding with your field headings.
    Let me know if you dont know how to create transformations.
    Kris...

  • How can I get the workspace login name in a custom jsp?

    I want to add a custom jsp in workspace, how can I pass the login name to this jsp?

    DrClap wrote:
    I think the OP wants to start up an application like MS Word and then operate it from a Java program.Doesn't The Monkey's Paw do that? What a second, according to Wikipedia:
    [http://en.wikipedia.org/wiki/The_Monkey%27s_Paw]
    <quote>
    ...the paw of a dead monkey is a talisman that grants its possessor three wishes, but the wishes come with an enormous price.
    The moral of the story is contained in this description of the paw: "It had a spell put on it by an old fakir," said the sergeant-major, "a very holy man. He wanted to show that fate ruled people's lives, and that those who interfered with it did so to their sorrow."
    </quote>
    So I guess that a non-sequitor ... or is it?

  • How can we get the artset from a .ai file without opening it?

    Hello All,
    I have one .ai file, lets say sample.ai file. located in C drive. so the complete file path is "C:\Sample.ai".
    and lets assume the sample.ai file has one traingle shape(3 path type arts) in it.
    Now I want to get the 3 path arts (artset)  from sample.ai file without opening it in AI.
    The function protoype is like below
    AIArtSet& artSet GetArtSetFromAFile( ai::FilePath& filePath );
    Is there any API like above function in AI? or is it possible to get the art(s) from a file without opening it in AI?

    Not to my knowlege. The API only operates on active documents as far as I know.

  • How can I get the value for static content of 1 jsp into another jsp

    Hi, I have a jsp which have a header ,now i want this header value in another jsp dynamically.Can u tell me how I can do it?

    What I want to know is that , is it possible to get the value of a static content of one jsp into another jsp,something like getParameter() method that we use to get the value of a field in the jsp to a servlet,or to another jsp,the only difference here is I do not have a field here but a static jsp content .

  • How can I get the exact pathname for a file on my computer?

    I need to enter a command in Terminal that contains the pathname of an application. I know what the path is but Terminal does not recognize it. How do I make sure the pathname is in the correct form?

    Enter the command up to the point of entering the file path and add a space, then drag the file into the terminal window. It will fill out the path.
    If you need to go further into the contents of the Application package, you can continue with /Contents...
    Another way is to start typing and then hit Tab to auto-complete. It will stop where it can't determine the next letter.
    So, type /App tab and it will fill in /Applications. Type a / and start with the name of the app, then tab and it should complete. Continue till you have the correct path.
    Spaces will be replaced with \<space>, so, App Store would end up as /Applications/App\ Store.app

  • How can I get the script Export Layers to Files to export compressed pngs?

    I would love to be able to take advantage of Photoshop's compressed png when using the script Export Layers to Files. I there a way I could modify the script to do this?
    TIA!!!
    ========================
    I found it ... I needed to add a line to the pngSaveOptions (around line #886) ...
                var saveFile = new File(exportInfo.destination + "/" + fileNameBody + ".png");
                pngSaveOptions = new PNGSaveOptions();
                pngSaveOptions.interlaced = false;
                // trying to compress png files
                pngSaveOptions.compression = 9;
                docRef.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE);
                break;
    =========================

    It does. The standalone XML Export was only offered by itself
    in the
    registration incentives. Sorry.
    Nancy Gill
    Adobe Community Expert
    Author: Dreamweaver 8 e-book for the DMX Zone
    Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
    2003)
    Technical Editor: DMX 2004: The Complete Reference, DMX 2004:
    A Beginner''s
    Guide, Mastering Macromedia Contribute
    Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
    Web Development
    "neilcreagh" <[email protected]> wrote in
    message
    news:f4rsrt$ptf$[email protected]..
    > I've just purchased Dreamweaver CS3 and, after
    registering, the email sent
    > offered me a free gift. I chose the free font. Another
    option is the
    > Dreamweaver XML Export Extension for Spry and I would
    like to purchase
    > this (it
    > stated the value at ?15) but I can't find it anywhere?
    >
    > The interaktonline website says that its functionality
    has been included
    > in
    > the Dreamweaver Developer Toolbox - but does this mean
    that I have to
    > purchase
    > the entire toolbox?
    >

  • How can I extract the metadata from multiple image files into a .csv?

    Hi.
    I'm looking for what I believe is a simple task but I am not sure how to go about it. I want to get the relevant data (seen in the screen grab below) into a spread sheet. I need to get the File Name, Size, Dimensions, Resolution and Kind into the spreadsheet so I can better analyze the data for my purposes. I have tried to find EXIF and IPTC extractors but only come across products that show me the info with no way of transferring it. I figured there must be a way to do this in the Finder. Maybe it's a simple Automator task (which I am not very good at) or a Script.
    Can anyone guide me thru or suggest a tool that would work?
    I was given a suggestion in another Disscussion to use a Plug-In for iPhoto. I found an old one but it dosnt have all of the metadata I need. It's missing the File Name and Resolution as options.
    http://www.tc.umn.edu/~erick205/Projects/Metadata%20Export/
    Thanks,
    Stephen

    Nevermind, I found it.
    +Inspector > Metrics > File Info: > drag the file's icon to the desktop+
    cheers

  • Exporting photos for UHDTV or Native 4K TV, what are the best settings ? (File: Quality File: Color Space, Image Sizing and resolution)   Or in other words; How can I get the smallest files but keep good quality for display on new UHDTV

    Exporting photos for UHDTV or Native 4K TV, what are the best settings ? (File: Quality File: Color Space, Image Sizing and resolution)   Or in other words; How can I get the smallest files but keep good quality for display on new UHDTV

    You're welcome, and thank you for the reply.
    2) Yesterday I made the subclips with the In-Out Points and Command-U, the benefit is that I've seen the clip before naming it. Now I'm using markers, it's benefit is that I can write comment and (the later) clip name at once, the drawback is that I have to view to the next shot's beginning before knowing what the shot contains.
    But now I found out that I can reconnect my clips independently to the format I converted the master clip to. I reconnected the media to the original AVI file and it worked, too! The more I work with, the more I'm sold on it... - although it doesn't seem to be able to read and use the date information within the DV AVI.
    1) Ok, I tried something similar within FCE. Just worked, but the file size still remains. Which codec settings should I use? Is the export to DV in MOV with a quality of 75% acceptable for both file size and quality? Or would be encoding as H.264 with best quality an option for archiving, knowing that I have to convert it back to DV if I (maybe) wan't to use it for editing later? Or anything else?
    Thank's in advance again,
    André

  • How can I get the light for the power button to go back on?

    I would like to get the power button light to work properly again. I have a p6813W desktop running Windows 7, 64 bit OS.
    The first time the machine went into sleep mode and was awoken the power button light went out and has not yet to come back on even after many shutdowns and restarts. I can't easity tell if my computer is on or off. How can I get the light to work properly again?
    Thanks.

    Mac's don't have UI scale options like Windows has.
    Either you can drop the screen resolution in Displays a wee bit and make things appear distorted, or do what I do and use the Universal Access and set a control key, then use a mouse wheel/scroll to zoom in and out where the mouse is pointed.
    For easier web surfing I've got a good solution here
    Better surfing options for hard of seeing users

  • How can I get the DPI of the current workstation?

    Hi can anyone help me?
    I want to know the dpi witch is set on a Windows system.
    How can i get it? Because i will reformat and fit the dpi of displaying images to the dpi of a current window system, e.g image= 200x200dpi and monitor=84dpi so the dpi of the images should be set to 84.
    But How can i get the current dpi of the Workstation?
    please help,
    florian

    yes but it sucks because windows-workstations
    manipulates the dpi to a standard value of 96 dpi...
    its equal if there is a 15" or a 17" monitor ...
    thanks floI agree, getScreenResolution() just doesn't work. Try changing your screen resolution setting (say from 1024x768 to 800x600) and this method will continue to return the same value!
    Can one adjust the scale so that you can draw a 1 inch square, for instance? The default affine transform property of the graphics object passed to paint methods is supposed to have 72 units = 1 inch, but that's not true. Again, adjust your screen settings and the same 72x72 square will come out in very different sizes.
    Is there any way to correct this, short of going to native code to get the screen resolution? I know that the screen display may be a bit miscallibrated, but anything would be better that the way it is now!

  • I am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier

    i am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier photo please help me to recover my photos

    Well I'll guess you're using iPhoto 11:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

Maybe you are looking for