1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

code cleanup

This commit is contained in:
Braun Patrik 2017-01-22 20:31:04 +01:00
parent 88c8d53d49
commit ba4cad7bef
2 changed files with 0 additions and 6 deletions

View File

@ -122,7 +122,6 @@ export class ThumbnailGeneratorMWs {
//check if thumbnail already exist //check if thumbnail already exist
if (fs.existsSync(thPath) === true) { if (fs.existsSync(thPath) === true) {
return next(); return next();
//return setTimeout(()=>{next();},2000);
} }
//create thumbnail folder if not exist //create thumbnail folder if not exist
@ -130,7 +129,6 @@ export class ThumbnailGeneratorMWs {
fs.mkdirSync(ProjectPath.ThumbnailFolder); fs.mkdirSync(ProjectPath.ThumbnailFolder);
} }
console.log("generating thumbnail", imagePath, size);
//run on other thread //run on other thread
pool.send({imagePath: imagePath, size: size, thPath: thPath}) pool.send({imagePath: imagePath, size: size, thPath: thPath})
.on('done', (out) => { .on('done', (out) => {

View File

@ -127,11 +127,8 @@ export class ThumbnailLoaderService {
task.taskEntities.forEach(te => te.listener.onStartedLoading()); task.taskEntities.forEach(te => te.listener.onStartedLoading());
task.inProgress = true; task.inProgress = true;
console.log("loading", task.gridPhoto.getThumbnailPath());
let curImg = new Image(); let curImg = new Image();
curImg.onload = () => { curImg.onload = () => {
console.log("loaded", task.gridPhoto.getThumbnailPath());
task.gridPhoto.thumbnailLoaded(); task.gridPhoto.thumbnailLoaded();
this.galleryChacheService.photoUpdated(task.gridPhoto.photo); this.galleryChacheService.photoUpdated(task.gridPhoto.photo);
task.taskEntities.forEach((te: ThumbnailTaskEntity) => te.listener.onLoad()); task.taskEntities.forEach((te: ThumbnailTaskEntity) => te.listener.onLoad());
@ -142,7 +139,6 @@ export class ThumbnailLoaderService {
}; };
curImg.onerror = (error) => { curImg.onerror = (error) => {
console.log("error", task.gridPhoto.getThumbnailPath());
task.taskEntities.forEach((te: ThumbnailTaskEntity) => te.listener.onError(error)); task.taskEntities.forEach((te: ThumbnailTaskEntity) => te.listener.onError(error));
this.taskReady(task); this.taskReady(task);