Loading Images Slow [Not over Internet]

Hi,
I'm wondering if the way my program is behaving is normal.
I'm loading about 200 images into my program. They're about 3 kilobytes each, so in total I'm loading about 700 kb worth of data.
I use the following code:
  for(int i=0; i<images.length; i++)
    mediaTracker.addImage(img,1);
mediaTracker.waitForAll();
However, loading these images often takes up to a minute. And this is not over the internet. This is directly read from the HD. Is this loading time normal? It seems strange that it takes a min to load not even 1 meg of data.
Please offer any suggestions.

I tried reading in 200 images that are about 6.5K each -- takes about 5 secs total on my shitbox of a machine.
import java.awt.image.*;
import java.io.*;
import java.net.*;
import java.util.*;
import javax.imageio.*;
public class Example {
    static final int UB = 200;
    public static void main(String[] args) throws IOException {
        createFiles();
        long start = System.currentTimeMillis();
        System.out.println("start");
        readFiles();
        long end = System.currentTimeMillis();
        System.out.println("elapsed millis = " + (end-start));
    static void createFiles() throws IOException {
        URL url = new URL("http://today.java.net/jag/bio/JagHeadshot-small.jpg");
        BufferedImage image = ImageIO.read(url);
        Iterator it = ImageIO.getImageWritersBySuffix("jpeg");
        ImageWriter w = (ImageWriter) it.next();
        for(int i=0; i<UB; ++i) {
            w.setOutput(ImageIO.createImageOutputStream(new File("images/temp" + i + ".jpeg")));
            w.write(image);
     static void readFiles() throws IOException {
         BufferedImage[] images = new BufferedImage[UB];
         Iterator it = ImageIO.getImageReadersBySuffix("jpeg");
         ImageReader r = (ImageReader) it.next();
         for(int i=0; i<UB; ++i) {
             r.setInput(ImageIO.createImageInputStream(new File("images/temp" + i + ".jpeg")));
             images[i] = r.read(0);
}

Similar Messages

  • Java chat program, works on single PC, but not over internet?

    I got bored so I started writing a chat client in java, its IRC style, a server and as many clients as you want. It works fine on a single computer (using 127.0.0.1 as the IP) but not over the internet.
    I've tried running the server and client on my home PC, set up the ports to be forwarded on my router and enabled them in the windows firewall but I get the error "Connection refused" when trying to connect using my external IP (ISP) address, same with me running the server and a mate running the client.
    The class chatHandler was basically stolen off the internet, the rest I wrote myself or modified bits of code to suit. I wrote it in netbeans with the GUI builder.
    I've hosted both projects in the single zip, if you want to run the application just open the .jar file in the dist folders, or view the source via the src folder, or alternatively you can load the project up in NetBeans so its easier to play with the GUI.
    So yeah if anyone can help me out with why its not working that'd be great, I've added the port to my firewall (default 60111). My ultimate goal is to implement an actual protocol so it isn't just sending plain text, then I can easily send files to mates etc.
    http://rapidshare.com/files/208309140/ChatProgram.zip.html
    Edited by: rolls on Mar 12, 2009 4:58 AM

    what I have done recently is this:
    have added java.exe, javaw.exe, the ports Im using to the windows firewall and also the ports I am using to my router.
    I have also tried changing :
    server = new ServerSocket(port);
    to:
    InetAddress IP = InetAddress.getByName(IPAddress);
    server = new ServerSocket(port, backlog, IP);
    (IPAddress = 192.168.1.3 my lan NIC)
    As I believe it was binding to my local loopback adaptor, hence not seeing any packets when using a packet analyser, however now I get an exception, after printing a stacktrace from the client I get this.
    However I can now connect using 192.168.1.3 just not using my external IP address.
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl .java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSoc ketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.j ava:366)
    at java.net.Socket.connect(Socket.java:519)
    at java.net.Socket.connect(Socket.java:469)
    at java.net.Socket.<init>(Socket.java:366)
    at java.net.Socket.<init>(Socket.java:180)
    at chatclient.Client.run(Client.java:60)
    at java.lang.Thread.run(Thread.java:619)
    Why is my connection getting refused? I've set up a virtual server and port forwarding on my router, and turned off the windows firewall.

  • XML (RSS) Spry Dataset File Works in Preview But Not Over Internet

    hello
    I am trying to build a custom feed reader using the Spry framework in Dreamweaver CS4 and everything seems to go smoothly until I actually host the file (with the accompanying js and css files) and try to view it over the internet
    previewing from DW shows everything working the way it should
    I feel like I am missing something obvious ... but not sure what
    thanks for any help!

    Hi, i have a similar problem..
    These URL returns a XML:
    1) http://www.bolsadesantiago.com/intradayServlet?symbol=IPSA
    2) http://www.valorfuturo.com/contenidos_vf/proyectos/clientes/penta/titularnoticias.asp
    I use a CS4 and both works in preview, but only first works over internet (IE7).
    I suspect that 2° has a problem of syntax XML, but work with jQuery.

  • Loader images do not appear when .swf is published.

    I have a series of images that I want to be able to swap out
    on a weekly basis in my flash piece. I used the image loader to
    call them from my webserver, and when I am in flash, editing my
    .fla, they appear perfectly. But once I publish the flash piece, a
    white box appears in their place, and the images never load.
    It doesn't matter whether I publish the flash to the web and
    place it in the same folder as the images, or just publish it and
    view it from my harddrive... either way, the images do not show in
    the .swf... they only show while editing in flash. I am calling
    dynamic text from the same server, and it works perfectly. Any help
    is appreciated.

    Hmm... hard to tell what is going on Josh. Can you provide a
    url to the
    swf?
    Dan Mode
    *THE online Radio*
    http://www.tornadostream.com
    *Must Read*
    http://www.smithmediafusion.com/blog
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    "Josh Rose" <[email protected]> wrote in
    message
    news:e9oqua$ad2$[email protected]..
    >I have a series of images that I want to be able to swap
    out on a weekly
    >basis
    > in my flash piece. I used the image loader to call them
    from my webserver,
    > and
    > when I am in flash, editing my .fla, they appear
    perfectly. But once I
    > publish
    > the flash piece, a white box appears in their place, and
    the images never
    > load.
    >
    > It doesn't matter whether I publish the flash to the web
    and place it in
    > the
    > same folder as the images, or just publish it and view
    it from my
    > harddrive...
    > either way, the images do not show in the .swf... they
    only show while
    > editing
    > in flash. I am calling dynamic text from the same
    server, and it works
    > perfectly. Any help is appreciated.
    >

  • IMac slot loading G3 will not recognize internet connection

    I am trying to get my slot loading G3 CRT ready to give to my daughter. It runs OS 10.3.9. My other computers running OS 10.4.10 and Airport Extreme run great on the Internet. Trying to get the internet connection recognized by the G3 via "Network" does not happen.
    As an aside, the battery is dead. I cannot find good instructions on how to change it. Could the dead battery have an adverse effect on the internet connection?

    Hi John
    The battery could have an input on this so get that changed. Changing it through the hatch is easier said than done - I've seen too many broken battery holders to support that option - I always open the mac up (10 screws and 10 minutes work).
    I'm assuming that your wireless card is working OK - does it show up in system profiler?
    Check that the arial is properly connected (while you have the bottom off) it's very easy for the connector to look connected but not be. To separate it from the card is quite difficult when it is properly connected. If it comes out with little or no effort then it probably wasn't in properly at all. There's a definate click when it goes fully home.
    This iMac G3 connects automatically as soon as it is switched on, If I turn the Airport off and plug in the ethernet, it automatically switches over and connects.
    In Network settings (System Preferences), Location is set to automatic and in both airport setting and ethernet setting, IPv4 is set to "Using DHCP"
    That's all there is to it really.
    Post back after you change the battery and let us know what happens.
    Cheers
    Donna

  • IE 7 and 8, photos not loading, image slideshow not working

    I have invested hours and hours and hours on my website, only to find out that what I see on my computer is not what others (users of IE versions 7 and 8) see.  I have determined from reading other queries on this forum that the Spry Image slideshow widget is a problem for just about everyone.  If this widget does not work in IE 7 or 8, is there another widget or another solution so that photos can be displayed on the website? 
    I would also like to know why some of the single photos on various pages do not load properly. 
    The website is:http://nhcstar.org

    Spry version 1.6x does not work very well with Spry version 1.7. Hence you will have to treat both versions with soft gloves.
    If, for instance you were to place version 1.6x above version 1.7, you might find you you will get some kindness in return.
    In other words,
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryDOMUtils.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryDOMEffects.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryWidget.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryPanelSet.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryFadingPanels.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryImageLoader.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryImageSlideShow.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/plugins/ImageSlideShow/SpryPanAndZoomPlugin.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryPanelSelector.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryContentSlideShow.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SprySliderPanels.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryFilmStrip.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/plugins/ImageSlideShow/SpryThumbnailFilmStripPlugin.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/plugins/ImageSlideShow/SpryTitleSliderPlugin.js" type="text/javascript"></script>
    Gramps

  • Load image, but NOT the whole page

    I have a simple html web page that I want to display a
    selection of images. I want to be able to have the images load when
    the next or previous buttons are clicked, but I don't want the
    whole page to reload. I know that I can do this with various
    server-side languages, but as this is a static website I didn't
    know if was possible to do it with javascript.
    Thanks

    >I have a simple html web page that I want to display a
    selection of images.
    >I
    > want to be able to have the images load when the next or
    previous buttons
    > are
    > clicked, but I don't want the whole page to reload. I
    know that I can do
    > this
    > with various server-side languages, but as this is a
    static website I
    > didn't
    > know if was possible to do it with javascript.
    You HAVE to use javascript, as you don't want the page to
    reload.
    Personally, I don't like photogalleries that do this, as I
    can't link
    directly to a specific image.
    that said, here's an option:
    http://www.huddletogether.com/projects/lightbox2/
    -Darrel

  • Video has controls locally, not over Internet

    Hello,
    I'm using Flash CS3.
    I used the Import video... wizard to import a QT movie and I
    used one of those template controls for playback control and
    published using the default settings. I have an .HTML, .SWF, .FLV
    and a AC_RunActiveContent.js files. When I launch the .HTML file
    locally on my computer, I get the movie with the controls in my
    browser (Safari and Firefox Mac). After uploading all the files to
    my server, when I click on the .HTML, I only get the video and no
    controls.
    Here is the .HTML:
    http://www.swproductions.com/clients/KLA-Tencor/KTC-Chinese-Flash.html
    I searched this forum for someone with this issue and didn't
    find any existing thread. I also looked in the manual and didn't
    find a solution.
    Thank you for any tips or help.
    Scot

    Sorry about wasting your time! :)
    I didn't realize a skin SWF was also created and needed. I
    found that and uploaded it and it works.
    Scot

  • Safari 7 in mavericks loading pages slow

    My safari loads pages slow (not every page). The blue progress bar is stuck at half way. But other browsers like chrome, firefox load the same page fast. And if I turn private browsing on, the same page loads as fast as the other browsers. I have tried every solution I have searched, but still can not solve this problem. any one encountered the same situation?

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, or by corruption of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and Wi-Fi on certain models.  The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. The question is whether Safari is still slower than other browsers.
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • Safari is loading webpages extremely slow and not loading images...

    Not loading webpages a lot of the time and not loading images on sites such as Facebook, Twitter, etc. I'm new to Mac and I'm running Safari on a Mac Mini. Help? Also deleted ~/Libraries/Safari and it didn't work.

    Please answer as many of the following questions as you can.
    1. Have you restarted your router and broadband modem since you first noticed the problem? If the answer is no, do that now and see whether there's any change.
    2. Are any other web browsers installed, and are they also slow?
    3. What about other Internet applications, such as iTunes and the App Store?
    4. Are there any other devices on the same network that can browse the Web, and are they also slow?
    5. If you can test Safari on another network, is it slow there too?
    6. If you connect to your router with Wi-Fi and you can also connect with Ethernet, do that and turn off Wi-Fi. Any difference?

  • Bought 4th Gen 3TB TC - streaming TV over the internet is now so slow and now is constantly buffering.  It seems the Airport Utility is always 'searching for new networks' - don't know if this is the problem.  It's not the internet speed as checked that.

    Bought 4th Gen 3TB TC - streaming TV over the internet is now so slow and now is constantly buffering.  It seems the Airport Utility is always 'searching for new networks' - don't know if this is the problem.  It's not the internet speed as checked that.  I took my old router upstairs and was streaming TV via my ipad seamlessly - the same program via the TC was constantly buffering.
    I just expected to be able to plug in the TC, so a simple set-up and experience wireless both upstairs and downstairs in my house.  For some reason the range is low and speed veru disappointing.
    I am far from being an IT expert but I would welcome advice about setting up this TC so we can enjoy the product as it was designed.  Please HELP!

    No silver bullet........but my suggestions may drive you in the right direction.
    1.  Unplug the power cable from the TC and wait 10-15 minutes before powering back up.   Seriously wait!
          Proceed to #2 if this dosen't help.
    2.  Unplug the power cable from the TC, ubplug the power cable from your Broadband Modem (assuming it's a cable modem), disconnect ethernet, and cable from modem. 
    2a.  Wait 10-15 minutes then re-connect cable, ethernet, and power back to modem (your modem should power up unless you have a power switch)  wait for all the modem lights to come on EXCEPT activity.
    2b.  Connect ethernet from modem to TC, and plug in the power cable to TC.
          Proceed to #3 if this dosen't help.
    3.  Reconfigure the TC.........Read here........http://support.apple.com/kb/HT3728
    All really simple to do....if you need additional help let me (us) know.

  • Is there a way to not load images in safari? Like on android you can tick a box to load images or no to the internet?

    Is there a way to not load images in safari on ios 7 like in android there is
    The option to load or not load images?

    My reply here was specific for this thread, but as you noted, I didn´t read careful enough. I wrongfully took for granted that issues in the More Like This box was platform dependent. I tried to apolgize accordingly, I would like to see the post deleted, but that doesn´t stop you from policing obviously.
    And instead of arrogantly replying about matters irrelevant for this thread, maybe you should start reading more carefully yourself. The posts you are referring to are related to large images failing to load properly in Safari 7. This is not as you claim "vaguely related". Take this elsewhere if you have a problem with it.
    Again, sorry for messing up the thread.

  • Firefox does not load images over HTTPS

    When viewing secure sites (HTTPS) images are not displayed on FF 3.6.6
    For example: I can not see images on Gmail, Google Images or StumbleUpon
    I have checked the images settings and it automatically loads images from all sites, there are no domains blocked
    There is no add-on to block images
    Javascript is enabled
    I've tested almost all network configuration but the problem persists
    If I inspect the image with Firebug 1.5.4 the image is available as preview
    The same page is correctly displayed on IE8
    I've tested in safe-mode but the error remains
    Again... I suspect it has something to do on how FF 3.6.6 handles HTTPS
    Even if you do not have an answer, post if you experience the same problem.
    Thanks for your help!
    == This happened ==
    Every time Firefox opened
    == After las upgrade

    Try "Reset all user preferences to Firefox defaults" on the [[Safe mode]] start window - See http://kb.mozillazine.org/Resetting_preferences
    See also http://kb.mozillazine.org/Preferences_not_saved
    Create a new profile as a test to check if your current profile is causing the problems
    See [[Basic Troubleshooting|#Make_a_new_profile|Basic Troubleshooting: Make a new profile]]
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins"
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Images from Photobucket very slow loading or do not load at all

    My website is graphic intensive. All the graphics are stored in Photobucket. If I used IE they instantly load and appear but if I use Mozilla Firefox there is a long delay in their appearance and sometimes they never show up. I contacted PB and they said to clear your cache, refresh, close your browser window, then flush your DNS (your computer system's cache) and reboot your entire system, including the modem and router. I did this but Firefox is still loading images very slowly and sometimes not at all

    You can try to check the loading times via Firefox > Web Developer > Web Console (click the Net button)
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    * http://kb.mozillazine.org/Resetting_preferences
    Also check the Firefox settings in your security software (firewall)

  • Update to IOS 6 has been a nightmare. Facebook would allow me to save pictures unless I granted access to my foto album. Does this mean my pictures are going be planted all over the web? The safari keeps crashing and loading is slow.

    update to IOS 6 has been a nightmare. Facebook would allow me to save pictures unless I granted access to my foto album. Does this mean my pictures are going be planted all over the web? The safari keeps crashing and loading is slow. Most infuriating is that YouTube was deleted from my entertainment apps and I now have to pay for it if I want it back!! This is a bloody disgrace.

    Back up all data.
    Boot into Recovery by holding down the key combination command-R at the startup chime. Release the keys when you see a gray screen with a spinning dial.
    Note: You need an always-on Ethernet or Wi-Fi connection to the Internet to use Recovery. It won’t work with USB or PPPoE modems, or with proxy servers, or with networks that require a certificate for authentication.
    When the OS X Utilities screen appears, follow the prompts to reinstall the OS. You don't need to erase the boot volume, and you won't need your backup unless something goes wrong. If your Mac was upgraded from an older version of OS X, you’ll need the Apple ID and password you used to upgrade, so make a note of those before you begin.

Maybe you are looking for

  • Windows 7 laptop does not recognize iphone 4 connection, does anyone have the same problem?

    I recently bought my brother's iphone 4 from him and connected to my computer and downloaded some pictures. Now, however when i connect it says my phone is charging but my windows 7 laptop doesn't recognize my phone, can anyone help me please???

  • FILE CAN NOT BE FOUND! please help

    I cannot play any of the songs in the itunes library or sync because the files can not be found. the files are on xternal drive. the itunes music folder location is set for the xternal drive. whenever i have to remove the drive from the laptop and th

  • Nokia 5235 firmware upgrade

    I am from India and have a 5235 the current installed version is 21.6.005. I have an Airtel connection if that helps. Nokia india site shows that there is a software upgrade available from march onwards (You will not find 5235 but if you search for 5

  • "ORA-03001: unimplemented feature" in Oracle 8.1.7

    When I'm trying to run even the simplest mappings in OWB 9.2 I'm getting the error code ORA-03001: unimplemented feature. I am running under Oracle 8.1.7 with 8.1.7 as source and target. I have tried to debug the package manually in Oracle but I can'

  • Itunes uninstall/reinstall PROBLEM.

    So, when I tried to download itunes 10.5, it didn't work, so I uninstalled itunes. I deleted all the residual programs I could find manually and with Revo. But every time I download itunes, it will go until the end and then gets stuck on "publishing