Quick loading JPEG images

Is there any way to load images quicker than with "Image image = new Image(shell.getDisplay(), fileName);"?
I have tried using AWT, Swing and now using SWT. I tried JAI and so but still load times are higher than what I need.
I need to load high res pictures, but the actual load times of about 800ms make my program unusable for its purpose, I would need something between 100 and 200ms for 1280x1024 JPEGs (it is possible in C++ and other languages, but I'm having a really hard time optimizing it in Java).
Thanks in advance.

Hi
Perhaps this method may be suited for u (i use oracle 8.1.6)........~_~
1)For example,Table emp3 has :
id integer,blob opa1
2)Make a file,test.ctl has this code:
load data
infile 'test.dat'
append
into table emp3
fields terminated by ','
(id,external_filename filler,
opa1 lobfile(external_filename)
terminated by eof)
3)Make a file,test.dat has :
1001,a.jpg
1002,b.jpg
1003,c.jpg
1004,d.jpg
..............( u can use perl to find out all the filename )
4)in the windows cmd,type:
c:\winnit> sqlldr userid=system/manager control=test.ctl
it will install all the jpg into ur database(don't forget to open ur database first !?)
Wish can help u ~_~
D.T.

Similar Messages

  • How to load .jpeg images dynamically

    Hi all,
    I am only perfect with basics of AS3 and flash. I need AS3
    code or a basic example/tutorial for loading of .jpeg images into
    flash from database.I had searched through google, but, any of the
    example won't match.
    Please, If anyone has their ideas, atleast send me the
    algorithm for your idea, so that i can try by implementing the
    idea.
    I think, once again when I open this topic, i will be
    getting my requirement.
    Thanks a lot in advance. Reply me soon.. It is urgent..
    Srihari.Ch

    The loading is easy:
    var l:Loader = new Loader();
    l.load( new URLRequest( "
    http://www.adobe.com/devnet/images/214x74/adc_lockup.jpg"
    addChild( l )
    But the database part, well... what kind of database did you
    have in mind?
    Store the images on disk and just have their path in the
    database or have the images as blob in the database. Are you
    looking for serverside script and SQL aswell? It's a question with
    a lot of different answers...

  • JAI can't load jpeg image, premature end of data segment error

    Hi,
    I have a customer sending in a jpeg image and I tried to use JAI to open the image. But the program throws the following error:
    However, I can see the jpeg file on Windows, and open it using Windows Picture/Paint etc software.
    Corrupt JPEG data: premature end of data segment
    Error: Cannot decode the image for the type :
    Occurs in: com.sun.media.jai.opimage.CodecRIFUtil
    java.io.IOException: Premature end of input file
         at com.sun.media.jai.codecimpl.CodecUtils.toIOException(CodecUtils.java:76)
         at com.sun.media.jai.codecimpl.JPEGImageDecoder.decodeAsRenderedImage(JPEGImageDecoder.java:48)
         at com.sun.media.jai.opimage.CodecRIFUtil.create(CodecRIFUtil.java:88)
         at com.sun.media.jai.opimage.JPEGRIF.create(JPEGRIF.java:43)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
         at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
         at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
         at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
         at com.sun.media.jai.opimage.StreamRIF.create(StreamRIF.java:102)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
         at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
         at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
         at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
         at com.sun.media.jai.opimage.FileLoadRIF.create(FileLoadRIF.java:144)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
         at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
         at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
         at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
         at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819)
         at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:770)
    PlanarImage image = img.createInstance();
    Thanks a lot for the help,

    I'm having this issue too - did you find any more information on this?

  • How to load jpeg images in database?

    I have an employees panel and it has a box to show employee's picture. Normally I double click on the box and it takes me to the folder where I have stored all employees jpeg file. I click on the one I need and then insert, it shows up on the panel and also saving the data in a table called PS_EMPLOYEE_IMAGE table.
    If I want to insert number of images at one time thru the back end like sqlplus is there a way to do it? This saves me lot of time instead of entering thru the panel. Can it be done? For example fot employee1 insert jpeg1, employee2 jpeg2 etc. DO I have to use any tool to convert these jpeg files into some other data and then insert it? Is there any pl/sql package to do it?. If some one can explain me with simple explanation I really appreciate as I am not an real oracle person. Googling for this issue says it can be done but it is not very clear in steps of doing it.

    Thanks for your help. I did exactly like what you described (see below)
    1) I created a image_file.txt file as shown below
    EMPLID|EFFDT|EFF_STATUS|IMAGE_FILE
    100000|08-FEB-2011|A|H:\SQL_Loader\George_Test.jpg
    100001|08-FEB-2011|A|H:\SQL_Loader\Eftihia_Test.jpg
    2) Then created EE_Image_Tbl.ctl file as shown below.
    OPTIONS (DIRECT=TRUE, SKIP=1)
    UNRECOVERABLE
    LOAD DATA
    APPEND
    INTO TABLE PS_EMPLOYEE_IMAGE
    FIELDS TERMINATED BY '|'
    (EMPLID
    ,EFFDT
    ,EFF_STATUS
    ,IMAGE_FILE FILLER CHAR(80)
    ,EE_IMAGE LOBFILE(IMAGE_FILE) TERMINATED BY EOF)
    3) then used the sql loader (load_ee_image.sql)
    $ sqlldr DH5M/ep5evs1@KDH5MI01 control=h:\sql_loader\EE_Image_Tbl.ctl log=h:\sql_loader\load_ee_image.log data=h:\sql_loader\image_file.txt
    SQL> --*
    SQL> commit;
    Commit complete.
    SQL> --*
    SQL> @h:\sql_loader\load_ee_image.sql;
    SQL> $ sqlldr DH5M/ep5evs1@KDH5MI01 control=h:\sql_loader\EE_Image_Tbl.ctl log=h:\sql_loader\load_ee_image.log data=h:\sql_loader\image_file.txt
    SQL> --*
    SQL> --*
    SQL> --*
    SQL> commit;
    Commit complete.
    SQL> --rollback;
    SQL> --*
    SQL> spool off
    L
    Number to skip: 1
    Errors allowed: 50
    Continuation: none specified
    Path used: Direct
    Load is UNRECOVERABLE; invalidation redo is produced.
    Table PS_EMPLOYEE_IMAGE, loaded from every logical record.
    Insert option in effect for this table: APPEND
    Column Name Position Len Term Encl Datatype
    EMPLID FIRST * | CHARACTER
    EFFDT NEXT * | CHARACTER
    EFF_STATUS NEXT * | CHARACTER
    IMAGE_FILE NEXT 80 | CHARACTER
    (FILLER FIELD)
    EE_IMAGE DERIVED * EOF CHARACTER
    Dynamic LOBFILE. Filename in field IMAGE_FILE
    SQL*Loader-418: Bad datafile datatype for column EE_IMAGE
    This is becasue my image datatype can be declared as LONG RAW dara type thru my application.
    When I created a table with image datatype as BLOB it worked.
    But I want to insert into the existing table where image is declared as LONG RAW. How to insert jpeg into this field. Do I have to convert anything? Thx.
    Edited by: user5846372 on Feb 8, 2011 1:18 PM
    Edited by: user5846372 on Feb 8, 2011 2:16 PM

  • Load JPEG as an ASPx page (from SQL database)

    We are trying to load JPEG images into the Flash player from
    an SQL database. But figuring out how to do it has us stumped.
    We are already displaying the images on a web page by
    setting the source of the image as a page. We use a separate file
    for retrieving an image, for example to display an image on a web
    page that is stored in the SQL database with an ID 1297 in the DB,
    use:
    <img src="/image.aspx?id=1297">
    Does anyone have any ideas how we might use a similar
    technique to load the jpeg images into the flash player? Or any
    other suggestions that will allow us to accomplish our object of
    viewing many thumbnail jpeg images in the Flash player?
    Thanks for any suggestions,
    Steve

    Hmm, maybe I'm naive, but what's the problem with
    loadMovie("/image.aspx?id=1297","container_mc");
    or even using the MovieClipLoader class with that url
    string?

  • How can I load a CMYK jpeg image

    How can I load a CMYK jpeg image (originally saved from Photoshop) and then
    turn it into an rgb BufferedImage, in order to display it on screen in an
    applet?
    I first tried ImageIO.read(), but that does not work for cmyk jpegs. I then
    looked into the com.sun.image.codec.jpeg package, and tried methods like
    decodeAsBufferedImage() and decodeAsRaster().
    The first one (decodeAsBufferedImage) returned an image, but it seems that
    it was interpreted as an ARGB, and the colors were incorrect.
    I then read the documentation which (amongst many other things) stated that
    "If the user needs better control over conversion, the user must request the
    data as a Raster and handle the conversion of the image data themselves."
    This made sense, so I took to decodeAsRaster(), only to find that I could
    not figure out how to carry out the desired conversion.
    Of course, I have looked into the documentation for BufferedImage, Raster,
    ColorModel, ColorSpace etc, but after a while I was lost. (Before I got lost
    I read that you can convert images with the help of methods like toRGB,
    toCIEXYZ.)
    I have a feeling that this is probably pretty simple if you just know how to
    do it, but I sure would need some directions here.
    Any help would be appreciated. Thanks.

    You can either use the "Place" command from the main menu, under "File", or you can just open it, select the move tool "V", the click in the image and drag it to the other file's tab.

  • TS3276 Having trouble sending jpeg images as attachments in Mac email.....they go thru as images and PC users can't see the SAVE or QUICK LOOK boxes that Mac mail has.  One friend scrolled over the image, right clicked on it and saved as a PNG file.

    Having trouble sending jpeg images as attachments in Mac email.....they go thru as images and PC users can't see the SAVE or QUICK LOOK boxes that Mac mail has.  One friend scrolled over the image, right clicked on it and saved as a PNG file.

    Apple Mail isn't going to change the format of any of your attachments. it isn't going to corrupt them either.
    Exchange is a transport protocol and server. The issue you describe is not related to Exchange.
    There are many different versions of Microsoft Outlook in use and they all have e-mail bugs. Different versions have different bugs. Some Apple Mail hack to get around a bug in Outlook 2003 may cause the same message to be problematic in Outlook 2000. Fix them both and another issue will cause trouble in Outlook 2007. You can't fix this. Apple can't fix this. Microsoft can and has but that is irrelevant if your recipients are using older versions.
    One specific problem is that Apple Mail always sends image attachments inline, as images, not as iconized files. You can change this with Attachment Tamer. Just be aware that use of this software will break other things such as Stationery. E-mail is just a disaster. To date, no one outside of Apple has ever implemented the e-mail standards from 1993. Apple has continually changed its e-mail software to be more compatible with the de-facto standards that Netscape and Microsoft have unilaterally defined and people documented as "standards" after the fact. The e-mail messages that Apple Mail sends are 100% correct and do not violate any of the original standards from 1993 or the Microsoft/Netscape modifications. The problem is entirely bugs and limitations in various versions of Outlook.

  • Loading JPEG/Gif images causes Out Of Memory Error

    Hello Java gurus, please shed some light on this.....
    I am not a java newbie, but I am a java newbie in the area of dealing with graphics. I am using JDK 1.4.2_01 on Win XP with 2.4ghz and 512 RAM. When I try to read in a (or a few) JPEG image into a JLabel using ImageIcon, I get an out of memory error everytime. This happens whether I am reading the image out of a jar file or out of a local directory. The JPEG's are 8.5" x 11", and range between 150kb to 900kb. I am trying to load approximately 10 images in a JTabbedPane using new JLabel(ImageIcon) on individual JPanels (one JPanel for each JPEG). Now I get the java.lang.outofmemory error whether I try to load 1 image or 10 images. Anyone got a clue as to what I am doing wrong? I actually do get one image loaded before the error gets thrown. So I do know that it is trying to load the right image. What is going on here? Is it an ImageIcon problem, or are there others who have run into this. It has brought this project to a grinding halt, and I had thought this would be the easier part!!!! Please help me out gurus! Thanks!

    What options/values are you suggesting that I set? Or do you mean something else? Thank you for any ideas that can help me solve this problem. I never had any issues dealing with using ImageIcon for toolbar button graphics (file sizes of 1-3kb), but now with dealing with full page graphics I have run into a brick wall with this out of memory error.

  • Jpeg image loaded with Loader- loadBytes() does not display when app is deployed on remote server

    I am loading a JPEG  image from the server, using the Loader->loadBytes() and that works when the app is deployed under my local Tomcat server.  When I deploy it on other servers the image is not displayed,  instead of the image I see II*
    On the server side I have java, Spring, BlazeDs and I use RemoteObject on the client.
    The code that loads the image looks like below:
    private function imageLoadResultHandler(event:ResultEvent):void {
        var result:ArrayCollection = event.result as ArrayCollection
        var bytes : ByteArray = result.getItemAt(0) as ByteArray;
        _loader = new Loader();
        _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderCompleteHandler);
        _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loaderFaultHandler);
        _loader.loadBytes(bytes);
    private function loaderCompleteHandler(event:Event):void {
        var loaderInfo:LoaderInfo = event.currentTarget as LoaderInfo;
        var img:Image = new Image();
        img.source = loaderInfo.content;
        myPanel.addChild(img);
    <mx:RemoteObject id="ro" destination="imageLoadService">
         <mx:method name="loadImage" result="imageLoadResultHandler(event)" fault="faultHandler(event)" />
    </mx:RemoteObject>
    Any help with this problem is much appreciated.
    Thank you,
    Lumi Velicanu

    Hi Dmitri,
    Thank you for the prompt reply, your question about the jpeg content was a helpful pointer.
    I solved the problem, it had nothing to do with flex, it was all on the java side. The image was obtained from converting a TIFF to a JPEG, the conversion was failing and the flex loader was receiveing a tiff and it did not know how to display it.
    The java problem was kind of interesting, I'll post it here as an FYI in case anybody cares :
    On my server the first writer returned by ImageIO was an instance of JPEGImageWriter and on the other servers was CLibJPEGImageWriter. And it happens that  only JPEGImageWrite can write the type of TIFF that we are having.
    The fix was to iterate through all the writers and pick the instace of JPEGImageWrite, instead of the first one found.
    Lumi

  • Why when i connect my phone to my laptop do my recent photos load as image files and not jpeg

    why is it that when i connect my phone to my laptop my recent photos load
    as image files and not jpeg as they used to.Is this another issue with ios 8

    Thank you. I did that and made sure my phone was open to the camera roll. I was able to locate the import command and the photos appeared. Thanks so much!

  • I cannot erase alias JPeg images on a memory card so that it will not accept any more which I try to load onto it, yet there are no actual images available if I click on any of them. The error message states that one or more cannot

    Cannot delete aliases for JPeg images on a lumix camera memory card even selecting individual images anjd trying to move to trash -error35 one or more items cannot be found. No image available on clicking or if card put back into camera-"no images to disply" Yet if try to add more images, message that card is full! Any suggestions?

    Deleting from iPhoto or image capture after import should be fine and shouldn't cause any issues. Deleting from the folder view of finder, can cause issues as the camera can the image is still there. You can try emptying the trash on your mac if you deleted them via the finder, as although you've deleted it, it's only marked as trashed and not actually deleted until you empty the trash - ie it won't relieve the space taken by the files.
    If your still having issues after you try this, you may be best formating the memory card. This will wipe all data on it though, so make sure you do copy anything off that yo u want to keep! Format from the camera, so that choosing the format>erase all option from the menu of most cameras.

  • How to load a jpeg image in to a database from a flex2 app

    Hi,
    how ouwld I browse the local fie system, select a jpeg image
    and then save
    it to a database using flex2?
    Anybody know of some sample code that I can look at?
    Thamls

    Hi Thamis,
    Take a look at the flash.net.FileReference class here:
    http://livedocs.macromedia.com/flex/2/langref/index.html
    This is the built in Flash support for file upload. You'd
    handle the upload with a servlet/jsp/etc. server-side component to
    save it to disk or as binary data in a database.
    Best,
    Seth

  • Flash lite loadmovie is not loading more than 5 jpeg images

    Hi,
    I am working on flash lite 2.0 for last few days. I am facing
    a big problem when using duplicatemovieclip and loading jpg images
    on these movieclips. It is showing an error that "it can not load
    more than 5 images on one frame on one click "
    I don't find any solutions for this. Please help
    Regards ,
    Gunjan

    why not load them sequentially using preloader code?

  • File size with JPEG Image files

    I recently had to re-load all of my photos from an external hard drive due to the fact that my hard drive crashed. When I did, I noticed that the files are JPEG Image files. As a result, the file size is considerably smaller than the original file and the quality is much less.
    Any suggestions on how to restore the file to the original format and quality?

    Connie:
    Yes, it seems you backup the Data folder instead of the Originals folder. Unfortunately, there's nothing you can do at this time.
    In the future, I suggest you copy the entire iPhoto Library folder to the external and then keep it updated with a backup application like Digital Backup, Snyk, etc. They compare B (the backup copy) with A (the working copy) and copy new or changed files from A to B to keep them identical. After the initial copy process, the subsequent backups are rather quick, about a minute or less.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Aperture applying unwanted adjustments when loading an image

    Hello,
    I'm having a bit of an issue with Aperture and I'm wondering if the community can help me.
    My camera is a Canon Eos 600D.
    I'm running Aperture 3.4.3 on a Mid 2010 iMac 27", with 8GB of Ram.
    Just lately, when I import and load images into Aperture, it seems to be applying unwanted adjustments to the photos just after it completes loading them.
    Let me explain further:
    I take pictures on the camera. Previewing them on the Canon they look as I would expect, and I'm happy with them.
    I insert the SD card from the camera into the Mac, and Aperture previews/shows the thumbnails of my photos, and they look just like they did on the camera.
    I import them into a given library.
    When viewing the thumbnails of the imported images in the library, they look the same, so I double click one to load it fullscreen. The image appears fullscreen, looking exactly as it did on the camera, and Aperture pops the word 'Loading' at the top of the image.
    Them when it finishes 'Loading', it seems to apply some unwanted adjustments to the photo. Mostly it applies a yellow wash to the image, and in some cases, it radically adjusts the levels.
    See examples below:
    This was what the image looked like after it had loaded:
    And this is what it should have looked like (I had to edit it BACK to what it had looked like on the camera).
    I should note that once Aperture has seemingly applied these unwanted adjustments, there is no way to undo them - 'Revert to Original' does nothing as as far as Aperture is concerned, this is the original image.
    Again, notice what happens when I quick preview an image:
    But when I switch out of Quick Preview, these unwanted adjustments are applied:
    Please, can anyone help out with this - it's driving me crazy.
    Is there a way of seeing what Aperture might be doing/applying behind the scenes? I've checked Preferences but can't see anything obvious.
    Many thanks in advance.
    dradd

    Are you shooting raw?
    Aperture is not doing any adjustments after import. Probably you have set your camera to do adjustments and you are using in-camera adjustment settings, like D-Lighting. These in-camera adjustments are reflected in the camera generated preview, that you are seeing when you are importing the image. After that, when you are opening the image, Aperture will create its own preview from the naked raw image. And that what you will see in the viewer. This preview shows exactly what your raw image is like, without any adjustments done by the camera. If you want the image processing results from the camera and not the original raw image as recorded by the camera from the sensor, import jpeg and not raw.
    See this discussion: TA24505 Why do d600 raw's look totally different than the jpg's that are imported together. When I select a raw, it looks as if it gets adjusted, but I can't figure out why...
    Regards
    Léonie

Maybe you are looking for