Changeset 613

Show
Ignore:
Timestamp:
04/09/09 01:23:04 (8 months ago)
Author:
ashot
Message:

slow down thumbnailing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/photos.js

    r602 r613  
    2626        calling_swf: false, 
    2727        to_call_swf: [], 
     28        to_thumb: [], 
    2829        wait_time: 2000, 
    2930        num_each_time: 10, 
     
    382383                for(var i=0;i<to_flash.length;i++){ 
    383384                        photos.waiting_to_thumb++; 
    384                         threads.workerPool.dispatch(new Thumb(to_flash[i][0].id, conf.thumb_size, to_flash[i][0].path), 
    385                            threads.workerPool.DISPATCH_NORMAL); 
    386                 } 
     385                        photos.to_thumb.unshift(to_flash[i][0]); 
     386                        //threads.workerPool.dispatch(new Thumb(to_flash[i][0].id, conf.thumb_size, to_flash[i][0].path), 
     387                           //threads.workerPool.DISPATCH_NORMAL); 
     388                } 
     389                photos.next_thumbnail(); 
    387390 
    388391                // Do extension stuff after we've added all of the photos but 
     
    480483                return p; 
    481484                 
     485        }, 
     486               
     487               
     488        next_thumbnail: function(){ 
     489                if(photos.to_thumb.length > 0 && photos.thumb_thread_counter ==0){ 
     490                        var t = photos.to_thumb.pop(); 
     491                        threads.workerPool.dispatch(new Thumb(t.id, conf.thumb_size, t.path), 
     492                           threads.workerPool.DISPATCH_NORMAL); 
     493                } 
    482494        }, 
    483495               
     
    981993                        if(!photos.list[i].thumb){ 
    982994                                photos.waiting_to_thumb++; 
    983                                 threads.workerPool.dispatch( 
    984                                 new Thumb(photos.list[i].id,  
    985                                         conf.thumb_size,  
    986                                         photos.list[i].path),  
    987                                         threads.worker.DISPATCH_NORMAL); 
    988                         } 
    989                 } 
     995                                photos.to_thumb.unshift(photos.list[i]); 
     996                                //threads.workerPool.dispatch( 
     997                                //new Thumb(photos.list[i].id,  
     998                                        //conf.thumb_size,  
     999                                        //photos.list[i].path),  
     1000                                        //threads.worker.DISPATCH_NORMAL); 
     1001                        } 
     1002                } 
     1003                                 
     1004                photos.next_thumbnail(); 
    9901005                         
    991                 //alert('still'+obj.flash); 
    992                  
    9931006                 
    9941007                // Don't bother if there are no photos 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/threads.js

    r602 r613  
    154154}; 
    155155var ThumbCallback = function(id, result, auto_select) { 
     156        photos.thumb_thread_counter-=1; 
    156157        this.id = id; 
    157158        this.result = result; 
     
    161162ThumbCallback.prototype = { 
    162163        run: function() { 
    163         if (photos.thumb_cancel === true) 
    164                 return; 
     164                if (photos.thumb_cancel === true) 
     165                        return; 
     166                 
     167                setTimeout("photos.next_thumbnail()", 300); 
     168                 
    165169                try { 
    166170                        if (conf.console.thumb) { 
     
    683687                if(photos.indexed_dirs[photos.file.path]){//that means we must have marked off everything, now watch over it slower 
    684688                        photos.wait_time = 3000 
    685                         photos.alert('clearing index, starting over'); 
     689                        //photos.alert('clearing index, starting over'); 
    686690                        photos.indexed_contents = {}; 
    687691                        photos.indexed_dirs = file.get_excluded_directories();