mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-01-26 05:27:35 +02:00
code cleanup
This commit is contained in:
parent
88c8d53d49
commit
ba4cad7bef
@ -122,7 +122,6 @@ export class ThumbnailGeneratorMWs {
|
||||
//check if thumbnail already exist
|
||||
if (fs.existsSync(thPath) === true) {
|
||||
return next();
|
||||
//return setTimeout(()=>{next();},2000);
|
||||
}
|
||||
|
||||
//create thumbnail folder if not exist
|
||||
@ -130,7 +129,6 @@ export class ThumbnailGeneratorMWs {
|
||||
fs.mkdirSync(ProjectPath.ThumbnailFolder);
|
||||
}
|
||||
|
||||
console.log("generating thumbnail", imagePath, size);
|
||||
//run on other thread
|
||||
pool.send({imagePath: imagePath, size: size, thPath: thPath})
|
||||
.on('done', (out) => {
|
||||
|
@ -127,11 +127,8 @@ export class ThumbnailLoaderService {
|
||||
task.taskEntities.forEach(te => te.listener.onStartedLoading());
|
||||
task.inProgress = true;
|
||||
|
||||
console.log("loading", task.gridPhoto.getThumbnailPath());
|
||||
let curImg = new Image();
|
||||
curImg.onload = () => {
|
||||
console.log("loaded", task.gridPhoto.getThumbnailPath());
|
||||
|
||||
task.gridPhoto.thumbnailLoaded();
|
||||
this.galleryChacheService.photoUpdated(task.gridPhoto.photo);
|
||||
task.taskEntities.forEach((te: ThumbnailTaskEntity) => te.listener.onLoad());
|
||||
@ -142,7 +139,6 @@ export class ThumbnailLoaderService {
|
||||
};
|
||||
|
||||
curImg.onerror = (error) => {
|
||||
console.log("error", task.gridPhoto.getThumbnailPath());
|
||||
task.taskEntities.forEach((te: ThumbnailTaskEntity) => te.listener.onError(error));
|
||||
|
||||
this.taskReady(task);
|
||||
|
Loading…
x
Reference in New Issue
Block a user