mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
bug fixing
This commit is contained in:
parent
8b9f287a88
commit
dc3a97ac6c
@ -149,7 +149,7 @@ export class ThumbnailGeneratorMWs {
|
|||||||
__dirname: __dirname,
|
__dirname: __dirname,
|
||||||
};
|
};
|
||||||
if (Config.Server.enableThreading == true) {
|
if (Config.Server.enableThreading == true) {
|
||||||
pool.send(imagePath)
|
pool.send(input)
|
||||||
.on('done', (out) => {
|
.on('done', (out) => {
|
||||||
return next(out);
|
return next(out);
|
||||||
}).on('error', (error) => {
|
}).on('error', (error) => {
|
||||||
@ -173,4 +173,4 @@ export class ThumbnailGeneratorMWs {
|
|||||||
private static generateThumbnailName(imagePath: string, size: number): string {
|
private static generateThumbnailName(imagePath: string, size: number): string {
|
||||||
return crypto.createHash('md5').update(imagePath).digest('hex') + "_" + size + ".jpg";
|
return crypto.createHash('md5').update(imagePath).digest('hex') + "_" + size + ".jpg";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ export class GalleryPhotoComponent implements IRenderable, OnInit, OnDestroy {
|
|||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
//schedule change after Angular checks the model
|
//schedule change after Angular checks the model
|
||||||
if (!this.gridPhoto.isThumbnailAvailable()) {
|
if (!this.gridPhoto.isThumbnailAvailable()) {
|
||||||
setImmediate(() => {
|
set Timeout(() => {
|
||||||
|
|
||||||
let listener: ThumbnailLoadingListener = {
|
let listener: ThumbnailLoadingListener = {
|
||||||
onStartedLoading: () => { //onLoadStarted
|
onStartedLoading: () => { //onLoadStarted
|
||||||
|
@ -121,7 +121,7 @@ export class GalleryLightboxComponent {
|
|||||||
|
|
||||||
//disable scroll
|
//disable scroll
|
||||||
this.overlayService.showOverlay();
|
this.overlayService.showOverlay();
|
||||||
setImmediate(() => {
|
setTimeout(() => {
|
||||||
this.lightboxDimension = <Dimension>{
|
this.lightboxDimension = <Dimension>{
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
@ -130,7 +130,7 @@ export class GalleryLightboxComponent {
|
|||||||
};
|
};
|
||||||
this.blackCanvasOpacity = 1.0;
|
this.blackCanvasOpacity = 1.0;
|
||||||
this.showPhoto(this.gridPhotoQL.toArray().indexOf(selectedPhoto));
|
this.showPhoto(this.gridPhotoQL.toArray().indexOf(selectedPhoto));
|
||||||
});
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public hide() {
|
public hide() {
|
||||||
|
@ -57,14 +57,14 @@ export class GalleryMapLightboxComponent implements OnChanges {
|
|||||||
document.getElementsByTagName('body')[0].style.overflow = 'hidden';
|
document.getElementsByTagName('body')[0].style.overflow = 'hidden';
|
||||||
this.showImages();
|
this.showImages();
|
||||||
|
|
||||||
setImmediate(() => {
|
setTimeout(() => {
|
||||||
this.lightboxDimension = <Dimension>{
|
this.lightboxDimension = <Dimension>{
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
width: this.getScreenWidth(),
|
width: this.getScreenWidth(),
|
||||||
height: this.getScreenHeight()
|
height: this.getScreenHeight()
|
||||||
};
|
};
|
||||||
});
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public hide() {
|
public hide() {
|
||||||
|
@ -68,7 +68,7 @@ export class ThumbnailLoaderService {
|
|||||||
path: photo.getIconPath()
|
path: photo.getIconPath()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setImmediate(this.run);
|
setTimeout(this.run, 0);
|
||||||
return thumbnailTaskEntity;
|
return thumbnailTaskEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ export class ThumbnailLoaderService {
|
|||||||
path: photo.getThumbnailPath()
|
path: photo.getThumbnailPath()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setImmediate(this.run);
|
setTimeout(this.run, 0);
|
||||||
return thumbnailTaskEntity;
|
return thumbnailTaskEntity;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ export class IconThumbnail extends ThumbnailBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.photo.isIconAvailable()) {
|
if (!this.photo.isIconAvailable()) {
|
||||||
setImmediate(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
let listener: ThumbnailLoadingListener = {
|
let listener: ThumbnailLoadingListener = {
|
||||||
onStartedLoading: () => { //onLoadStarted
|
onStartedLoading: () => { //onLoadStarted
|
||||||
@ -101,7 +101,7 @@ export class IconThumbnail extends ThumbnailBase {
|
|||||||
this.thumbnailTask = this.thumbnailService.loadIcon(this.photo, ThumbnailLoadingPriority.high, listener);
|
this.thumbnailTask = this.thumbnailService.loadIcon(this.photo, ThumbnailLoadingPriority.high, listener);
|
||||||
|
|
||||||
|
|
||||||
});
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -134,7 +134,7 @@ export class Thumbnail extends ThumbnailBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.photo.isThumbnailAvailable()) {
|
if (!this.photo.isThumbnailAvailable()) {
|
||||||
setImmediate(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
let listener: ThumbnailLoadingListener = {
|
let listener: ThumbnailLoadingListener = {
|
||||||
onStartedLoading: () => { //onLoadStarted
|
onStartedLoading: () => { //onLoadStarted
|
||||||
@ -162,7 +162,7 @@ export class Thumbnail extends ThumbnailBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
"main": "./backend/server.js",
|
"main": "./backend/server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
|
"pretest": "tsc",
|
||||||
"test": "ng test --single-run && mocha --recursive test/backend/unit",
|
"test": "ng test --single-run && mocha --recursive test/backend/unit",
|
||||||
"start": "node ./backend/server",
|
"start": "node ./backend/server",
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
|
Loading…
Reference in New Issue
Block a user