Changes between Version 2 and Version 3 of Ticket #15574, comment 14


Ignore:
Timestamp:
2017-12-04T18:31:51+01:00 (8 years ago)
Author:
cmuelle8

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15574, comment 14

    v2 v3  
    44
    55EDIT2: include proper checks in the event image dimensions cannot be read (because of file format or other condition), this ensures that the thread will not linger around waiting forever.  if lots of such images are loaded and switched between these lingering threads may aggregate, so not waiting forever and properly let them finish is somewhat important.
     6
     7EDIT3: add repaint call if reading width and height timed out and run() method returns early
    68{{{
    79  #!patch
     
    5759                 }
    5860             }
    59 @@ -243,19 +252,26 @@
     61@@ -243,19 +252,27 @@
    6062             Image img = Toolkit.getDefaultToolkit().createImage(file.getPath());
    6163 
     
    8082+                            synchronized (ImageDisplay.this) {
    8183+                                errorLoading = true;
     84+                                ImageDisplay.this.repaint();
    8285+                                return;
    8386+                            }
     
    9194                 }
    9295             }
    93 @@ -279,24 +295,19 @@
     96@@ -279,24 +296,19 @@
    9497                         Thread.sleep(5);
    9598                     } catch (InterruptedException e) {
     
    119122                 if (this.file != ImageDisplay.this.file) {
    120123                     // The file has changed
    121 @@ -566,10 +577,12 @@
     124@@ -566,10 +578,12 @@
    122125         public void mouseReleased(MouseEvent e) {
    123126             File file;