Creating thumbnails of image when u know only path

Hi,
is there some way to create thumbnails or icon of varying size images,path of which are stored in a database ?
If any one lnow so html way of doing that.Plz let me know

If you have stored the path of the image in the database you can read the image file to get the data of the image.
just use
ImageIcon icon = new ImageIcon("Path as a String");
Image i = icon.getImage();but if the path is a URL follow this
URL u = new URL("Path as a valid url string");
ImageIcon icon = new ImageIcon(u);
Image i = icon.getImage();
Note:-[b]
ImageIcon is in package javax.swing
Image is in package java.awt

Similar Messages

  • Create a business model when we have only one source table

    Hi,
    How to create a business model when we have only one source table in Physical layer
    Regards
    Swathi

    This is very much possible and feasible. Its called as Single Table model. Good example is SA System Subject Area where we just have a single physical source. No need to create Alias in Physical. Simply use the same table twice in BMM with one Logical Table as Dummy Fact..Like say Count of Users (aggregated). Then apply normal Complex join in BMM and present in presentation layer.
    http://gerardnico.com/wiki/dat/obiee/single_table_model
    http://gerardnico.com/wiki/dat/obiee/sasystem

  • Creating Thumbnails of Images without AWT

    I've searched in a lot of places, and am becoming increasingly surprised I cannot find a straightforward answer to a problem I have. I run Tomcat on a server which has no X11, and I do not want to install it. However, I am also trying to create a servlet which will take an image from a byte array and create a thumbnail of it.
    While I have seen many examples of this, all use AWT, which seems to require using X11 or some windowing system even to run at all (despite my not trying to create a window or anything). While I understand that there is an option that can be added to the initialization script for Tomcat ("JAVA_OPTS=-Djava.awt.headless=true") I would far prefer simple code that didn't use AWT at all.
    Does anyone know how to create a thumbnail or resize an image without the use of the AWT library whatsoever? Thanks very much!

    Hmm... sorry I didn't know that.
    I remember seeing some section on this website about Java Imaging or something like that and it seemed totally independent of AWT.
    I came accross another imaging article:
    http://johnbokma.com/java/obtaining-image-metadata.html , this one doesn't seem to use AWT - at least I don't see any in the imports.
    May be Images are supposed to work only with AWT.
    Here's another set of examples:
    http://www.exampledepot.com/egs/javax.imageio/pkg.html
    that demonstrates the javax.imageio package, but those examples also use AWT.
    I think one could re-size an image on a website to create thumbnails, by specifying a percent width and height. and may be there's no need to have a package to create thumbnails on a web page when it could be done with HTML and that's probably why there isn't image processing for web pages (this is just my guess work, I could be wrong)
    Message was edited by:
    appy77

  • What can I do to create a disk image when I continue to get the prompt "permission denied"?  I have run the permission repair, restarted the computer and nothing changes.

    I want to create a disk image for important information.  I continue to get "Permission Denied" even though I have run the disk utility for repair and verify disk permissions.  Is there a solution for this?

    I had same problem as I was trying to build a windows iso following the bootcamp instructions (last evening).  I learned you cannot create a disk image at root due to changes in the operating system made by apple.  As a user (even an admin user) you can only create a disk image below root (such as in your desktop).  Any attempt to creat an image at root will return permission denied.
    The Apple Disk Utility (on three macs I have tried so far) defaults to creating an iso image at the root.  If you tell it to create the image - you immediately get a permission denied error.
    None of the iso creation instructions I have found on apple site so far speak to this. 

  • Time Machine creates new disk image when backing up but files not visible

    When I back up my files (daily) to tan external drive TM creates a new disk image (named laptop) on my desktop (in addition to the image for the external drive named TIme Machine Backups). When I click on the new disk image while it's backing up I see a list of recent backups. However the disk image disappears after completing the back up and the files do not appear in the Star Wars screen - only old back-ups from 2009. How can I access the newest backups?

    alanol wrote:
    A disk image labeled Time Machine Backups resides permanently on the desktop
    Right-click it, and select +Get Info.+ See what the path is (after +Disk image+ near the top of the General section).
    Also the amounts for Capacity and Used.
    as a consequence of the repair a sparse bundle (Zero KB) folder was created.
    No. That may have been created by the new backup, though.
    Also a new "lost +found" folder was created containing several ".emix" files.
    Those are email files.
    Net, net - same basic problem, can't see the newest backups in the Star Wars screen.
    I suspect they're in the disk image.
    Do you have any external HDs connected?
    Try a "full reset" of Time Machine, per #A4 of Time Machine - Troubleshooting (or use the link in *User Tips* at the top of this forum).

  • Creating thumbnails / resampling image for DisplayImageFile?

    Hello All,
    I was trying to build a panel to show multiple photos (50) for verification (double click to view whole image in separate window) prior to upload for final storage.
    I need to resample / thumbnail to approximately fit the control so that the memory usage does not go through the roof. These images will be from several cameras and as such the image type may change  - but starting with jpg would go along way.
    This may be as simple as a missed setting on the uir but I was not able to figure it out. I am not opposed to creating temp thumbnails on the hard drive and clean them away later.
    Prefer CVI or SDK to ActiveX etc.
    Thanks in advance,
    Greg
    Solved!
    Go to Solution.

    ebalci wrote:  Probably SetCtrlBitmap function was there just to show an alternative.
    I commented it without destroying the program requirements.
    You can also put GetCtrlDisplayBitmap and DiscardBitmap functions inside "if (save)" block.
    This may make things quicker if saving is not required.
    Well, actually not. SetCtrlBitmap helps reducing memory occupation in the process: on a limited-memory machine, loading several big images can ultimately lead to a Out-of-memory error in DisplayImageFile and in not displaying the image on the panel. Reloading a smaller bitmap in the controls reduces this effect. As an example, on a 1Gb memory machine progressive loading of a 900x650 pixels bmp image generates such error after more or less 40 images loaded. The bigger the image, the fastest this effect will show. Trapping that non-fatal error permits the function to conclude but the images are not loaded to screen.
    In that scenario, adding DiscardBitmap has no effect at all, as memory for the image is allocated inside the picture control.
    ...it seems your development machine is much bigger than mine 
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • HOw to find out a report name when you know only the name of background job

    Hi experts ,
    my question is i need to find out teh report name for which i knew only the background job name of the report .
    thanx
    Venky.

    Go to tcode SM37->Give job name and execute->choose tool bar button STEPS (Disply Steps list) ->Then you will get program or command

  • Thumbnails of images will not show

    When using bridge on some of my computers, thumbnails of images will not show, only a generic .eps icon.  We are trying to view files from an Art Explosions CD library and are using Bridge CS6 V 5.0.0.399

    Check this:
    Project - Properties - Flex Compiler - Additional compiler options:    -use-network=true
    If this post answered your question or helped, please mark it as such.

  • Why suddenly unable to create a disk image from a CD?

    I successfully created a disk image from a CD only 5 days ago. Now when I try to create a disk image from a CD (with Disk Utility) the Superdrive rumbles along for sveral minutes, while the progress bar indicates that it has reached the end of its progress.
    Only after all that does a dialog box indicate:
    "Unable to create "___.dmg"-Invalid Argument. "
    I haven't added software but did upgrade to iTunes 6. Doubtful that could affect my abilty to create a disk image.
    Would someone kindly shed some light on why this may be happening?
    Steve

    Is it strange that this problem seems CD-specific?
    Some CDs are copy-protected and some CDs are not copy-protected; so, no, it's not strange at all that you should be able to copy some CDs and not be able to copy others.
    Tuttle
    1682/8380

  • There was an error creating your disk image.

    FCPX v 10.1 In exporting a completed project to a disk image, the following error message came up:   There was an error creating your disk image.  VIDEO_INPUT_READ_ERR
    It only has occurred on one project (so far).
    Has anyone encountered this type of error and found a suitable work around?

    If it only happened with that one project, a reasonable  guess is that the problem is in the media – either an original clip or a render file. Deleting the render files from the File menu for both project and events would be a good place to start. Turn off BG Rendring and without rendering,  see whether a short selection  will export as a master file. If it does, try the img again.
    Russ

  • IPhoto Not Displaying images in full-size, only thumbnails

    I have iPhoto 11.9.4.2 installed in iMac 27" running Mac OS 10.7.5.
    Up until last night iPhoto has been great. Last night I added about 100 images to my library which is a pretty typical update for me. The pics all transferred fine. All my exisiting and new images are visible in thumbnail mode, however when I 'click' on any one of my new or existing images so that I can view only that image in iPhoto, the image flashes up for 1 second then disappears. If I use my mouse or arrow keys I can go to the next image which again flashes up temporarily then disappears.
    When I adjst the 'zoom' on the lower left portion of the iPhoto window, I can see a very small version of the image I would like to see with a box/rectangle over the area that I assume would be visibile if I zoomed in what would normally be a full-sized image.
    Any ideas?

    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 to create thumbnail images on the fly from JSP or servlet?

    Hi all,
    Iam new to this forum. I need a solution for the problem iam facing in building my site. Ihave groups and briefcase section in my site. I allow users to upload files and pictures.
    When they upload pictures i need to create thumbnail for them on the fly.
    Is there any taglibs or java source to do this from JSP or servlets.
    It would be very greatful if i can get an early answer.
    Please let me know if there is any other forum where i can get better answer, if not here?
    thnx.

    Here is how you can create dynamic images:
    http://developer.java.sun.com/developer/JDCTechTips/2001/tt0821.html#tip2
    However, if you want to create gifs/jpegs and save them to the disk it depends from where you want to create the images. It is different if you are creating from another image or just drawing one from scratch etc.. But in the end you will probably need to use one of the imageencoder classes and write the result to the disk with the file io classes.

  • Creating thumbnail images and storing it as gif or jpg

    Hi all,
    Iam new to this forum. I need a solution for the problem iam facing in building my site. I have groups and briefcase section in my site. I allow users to upload files and pictures.
    When they upload pictures i need to create thumbnail for them and store them as gif or jpeg.
    It would be very greatful if i can get an early answer.
    Please let me know if there is any other forum where i can get better answer, if not here?
    thnx

    I found the following searching through the forum, under jpeg or thumbnail, a while back -- maybe you can use it:
    import java.awt.Image;
    import java.awt.Graphics2D;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.FileOutputStream;
    import javax.swing.ImageIcon;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    class Thumbnail {
    public static void main(String[] args) {
    createThumbnail(args[0], args[1], Integer.parseInt(args[2]));
    * Reads an image in a file and creates a thumbnail in another file.
    * @param orig The name of image file.
    * @param thumb The name of thumbnail file. Will be created if necessary.
    * @param maxDim The width and height of the thumbnail must
    * be maxDim pixels or less.
    public static void createThumbnail(String orig, String thumb, int maxDim) {
    try {
    // Get the image from a file.
    Image inImage = new ImageIcon(orig).getImage();
    // Determine the scale.
    double scale = (double)maxDim/(double)inImage.getHeight(null);
    if (inImage.getWidth(null) > inImage.getHeight(null)) {
    scale = (double)maxDim/(double)inImage.getWidth(null);
    // Determine size of new image. One of them
    // should equal maxDim.
    int scaledW = (int)(scale*inImage.getWidth(null));
    int scaledH = (int)(scale*inImage.getHeight(null));
    // Create an image buffer in which to paint on.
    BufferedImage outImage = new BufferedImage(scaledW, scaledH,
    BufferedImage.TYPE_INT_RGB);
    // Set the scale.
    AffineTransform tx = new AffineTransform();
    // If the image is smaller than the desired image size,
    // don't bother scaling.
    if (scale < 1.0d) {
    tx.scale(scale, scale);
    // Paint image.
    Graphics2D g2d = outImage.createGraphics();
    g2d.drawImage(inImage, tx, null);
    g2d.dispose();
    // JPEG-encode the image and write to file.
    OutputStream os = new FileOutputStream(thumb);
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
    encoder.encode(outImage);
    os.close();
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(0);
    V.V.

  • Import Images into slide show - Creating Thumbnail images -Hang

    I am using iDVD 7. I imported my images into a slideshow. The pictures were not in iPhoto but just a folder that I created and edited in Photoshop. Once I import the images, the window shows all the file names as expected but all the Image Thumbnails are blank and the top of the window there is a message "+Creating thumbnail images... (32 remaining)+" with a spinning wheel next to the message. This message stays there forever. The 32 is the number of images in the slideshow. I can do most things in iDVD while this is going on, but I cannot add the audio I want.
    What is causing this and can I get it to stop?

    To add to this I decided to remove the slideshow and now import the pictures from iPhoto. I can only get ride of the message by closing iDVD down. When I relaunch iDVD the message is gone. When I now import the pictures from iPhoto the same thing happens where it hangs on creating thumbnail images.

  • Create thumbnail from selected images

    Hi,
    in my app the user can choose some pictures from his local
    file system.
    I want to create a smaller image of every selected picture.
    So I do this for each image:
    for( var f = 0; f < e.files.length; f++ ){
    name = e.files[f].name;
    src = e.files[f].url;
    path = e.files[f].parent.url;
    files.push( e.files[f] );
    //...some other code, not important for this...//
    image = new air.Loader();
    image.contentLoaderInfo.addEventListener(
    air.Event.COMPLETE, function() {
    var ratio = null;
    if (image.width <= 100) {
    thumb_height = image.height;
    thumb_width = image.width;
    ratio = 1;
    else {
    var thumb_width = 100;
    var thumb_height = null;
    var factor = image.width / thumb_width;
    thumb_height = Math.round(image.height / factor);
    ratio = 100/ image.width;
    if (thumb_height > thumb_width) {
    thumb_height = 120;
    factor = image.height / thumb_height;
    thumb_width = Math.round(image.width / factor);
    ratio = 100/ image.width;
    var bmp = new air.BitmapData( thumb_width, thumb_height );
    var temp = air.File.createTempFile();
    var desktop = null;
    var matrix = new air.Matrix();
    var png = null;
    var stream = new air.FileStream();
    var div = null;
    var elem = null;
    matrix.scale( ratio,ratio );
    bmp.draw( image.content, matrix );
    png = runtime.com.adobe.images.PNGEncoder.encode( bmp );
    stream.open( temp, air.FileMode.WRITE );
    stream.writeBytes( png, 0, 0 );
    stream.close();
    desktop = air.File.desktopDirectory.resolvePath( toPNG(
    e.files[f] ) );
    temp.moveTo( desktop, true );
    image.load( new air.URLRequest(e.files[f] ) );
    function toPNG( orig )
    return orig.name.substr( 0, orig.name.length -
    orig.extension.length ) + 'png';
    The problem is, that the "thumbnail" is only created of the
    last selected image. I think it has something to do with the
    air.Event.COMPLETE event. But when I kick that off, an error
    occures: Error #2015: Invalid BitmapData. at
    flash.display::BitmapData().
    Hope somebody can help. Thanks in advance

    Here´s a nice example that does exactly what I want:
    <html>
    <head>
    <title>Thumbnails</title>
    <script src="library.swf"
    type="application/x-shockwave-flash"></script>
    <script src="AIRAliases.js"
    type="text/javascript"></script>
    <script type="text/javascript">
    var MAX_HEIGHT = 100;
    var MAX_WIDTH = 100;
    var files = null;
    var index = 0;
    var loader = null;
    var output = null;
    function loadImages()
    if( index < files.length )
    output = document.createElement( 'div' );
    loader.load( new air.URLRequest( files[index].url ) );
    } else {
    loader.visible = false;
    function doLoad()
    loader = new air.Loader();
    loader.contentLoaderInfo.addEventListener(
    air.Event.COMPLETE, doLoaderComplete );
    window.nativeWindow.stage.addChild( loader );
    btnOpen.addEventListener( 'click', doOpenClick );
    function doFilesSelect( e )
    files = e.files;
    index = 0;
    loadImages();
    function doLoaderComplete()
    var bmpd = null;
    var encoder = null;
    var img = null;
    var jpg = null;
    var matrix = null;
    var ratio = 0;
    var realHeight = loader.contentLoaderInfo.height;
    var realWidth = loader.contentLoaderInfo.width;
    var stream = null;
    var thumb = null;
    var thumbHeight = 0;
    var thumbWidth = 0;
    if( realWidth > 0 )
    if( realWidth <= MAX_WIDTH )
    thumbHeight = realHeight;
    thumbWidth = realWidth;
    ratio = 1;
    } else {
    thumbWidth = MAX_WIDTH;
    thumbHeight = 0;
    factor = realWidth / thumbWidth;
    thumbHeight = Math.round( realHeight / factor );
    ratio = MAX_WIDTH / realWidth;
    if( thumbHeight > thumbWidth )
    thumbHeight = MAX_HEIGHT;
    factor = realHeight / thumbHeight;
    thumbWidth = Math.round( realWidth / factor );
    ratio = MAX_WIDTH / realWidth;
    matrix = new air.Matrix();
    matrix.scale( ratio, ratio );
    bmpd = new air.BitmapData( thumbWidth, thumbHeight );
    bmpd.draw( loader, matrix );
    encoder = new runtime.com.adobe.images.JPGEncoder( 85 );
    jpg = encoder.encode( bmpd );
    thumb = air.File.desktopDirectory.resolvePath( 'thumb_' +
    files[index].name );
    stream = new air.FileStream();
    stream.open( thumb, air.FileMode.WRITE );
    stream.writeBytes( jpg, 0, 0 );
    stream.close();
    output.innerHTML = files[index].name + ': ' + realWidth + '
    x ' + realHeight;
    document.body.appendChild( output );
    img = document.createElement( 'img' );
    img.src = thumb.url;
    output.appendChild( img );
    index = index + 1;
    loadImages();
    function doOpenClick()
    var browse = air.File.desktopDirectory;
    browse.addEventListener( air.FileListEvent.SELECT_MULTIPLE,
    doFilesSelect );
    browse.browseForOpenMultiple(
    'Select Images',
    [new air.FileFilter( 'Image Files',
    '*.gif;*.jpg;*.jpeg;*.png' )]
    </script>
    </head>
    <body onLoad="doLoad();">
    <input id="btnOpen" type="button" value="Open..." />
    </body>
    </html>

Maybe you are looking for

  • Check what records are missing in child tables when compared to Primary tables

    I have a person table(200 records with 200Persons),Column Person Id (PK),FN, LN,USERNAME and there are 13 tables which are referenced by Person id ex: Attachement table has a column UpdatedPersonid ex: Inventory table has a column ModifiedbyPersoind

  • Ay way to batch change date?

    I just realized that all my photos since January say 2009. Not sure how this happened, camera must be set wrong. Is there any way I can select all this years photos and just change the year? The date and time otherwise is correct. Doesn't seem to all

  • HttpClusterServlet Provlems (5.1.0SP4)

    3 WLAS 5.1.0SP4 running in a cluster, with an additional WLAS 5.1.0SP4           running HttpClusterServlet as the default servlet. Very light load (single           user).           Everything starts out fine, but after a few minutes I start getting

  • Re-install PSE12 on a new computer

    Hi everybody, I've recently bought PSE12. It is installed on both my computer at home and on my laptop. If I change one of my computer how can I do to re-install it? Thanks for your reply.

  • Correct back order qty on AR Invoice

    SBO 8.8 Client wants BO qty to print on invoice. Here's the problem/bug/my mistake. Thereu2019s a field called u2018QtyToShipu2019, which is really the quantity left to ship, on every item row of an A/R doc in Business One. Say we create a sales orde