mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
null image error fix
This commit is contained in:
parent
c09052a2a5
commit
16f1afdf10
@ -25,9 +25,8 @@ export class ThumbnailGeneratorMWs {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Config.Client.concurrentThumbnailGenerations = Math.max(1, os.cpus().length - 1);
|
|
||||||
|
|
||||||
|
|
||||||
|
Config.Client.concurrentThumbnailGenerations = 1;
|
||||||
switch (Config.Server.thumbnail.processingLibrary) {
|
switch (Config.Server.thumbnail.processingLibrary) {
|
||||||
case ThumbnailProcessingLib.Jimp:
|
case ThumbnailProcessingLib.Jimp:
|
||||||
this.ThumbnailFunction = ThumbnailRenderers.jimp;
|
this.ThumbnailFunction = ThumbnailRenderers.jimp;
|
||||||
@ -45,6 +44,7 @@ export class ThumbnailGeneratorMWs {
|
|||||||
|
|
||||||
if (Config.Server.enableThreading == true &&
|
if (Config.Server.enableThreading == true &&
|
||||||
Config.Server.thumbnail.processingLibrary == ThumbnailProcessingLib.Jimp) {
|
Config.Server.thumbnail.processingLibrary == ThumbnailProcessingLib.Jimp) {
|
||||||
|
Config.Client.concurrentThumbnailGenerations = Math.max(1, os.cpus().length - 1);
|
||||||
const Pool = require('threads').Pool;
|
const Pool = require('threads').Pool;
|
||||||
this.thPool = new Pool(Config.Client.concurrentThumbnailGenerations);
|
this.thPool = new Pool(Config.Client.concurrentThumbnailGenerations);
|
||||||
this.thPool.run(this.ThumbnailFunction);
|
this.thPool.run(this.ThumbnailFunction);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div #photoContainer class="photo-container" (mouseover)="hover()" (mouseout)="mouseOut()">
|
<div #photoContainer class="photo-container" (mouseover)="hover()" (mouseout)="mouseOut()">
|
||||||
<img #img [src]="thumbnail.Src" [hidden]="!thumbnail.Available">
|
<img #img [src]="thumbnail.Src" *ngIf="thumbnail.Available">
|
||||||
|
|
||||||
<gallery-grid-photo-loading [animate]="thumbnail.loading" *ngIf="!thumbnail.Available">
|
<gallery-grid-photo-loading [animate]="thumbnail.loading" *ngIf="!thumbnail.Available">
|
||||||
</gallery-grid-photo-loading>
|
</gallery-grid-photo-loading>
|
||||||
|
@ -101,6 +101,15 @@ export class GalleryPhotoComponent implements IRenderable, OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
public getDimension(): Dimension {
|
public getDimension(): Dimension {
|
||||||
|
if (!this.imageRef) {
|
||||||
|
return <Dimension>{
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
width: 0,
|
||||||
|
height: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return <Dimension>{
|
return <Dimension>{
|
||||||
top: this.imageRef.nativeElement.offsetTop,
|
top: this.imageRef.nativeElement.offsetTop,
|
||||||
left: this.imageRef.nativeElement.offsetLeft,
|
left: this.imageRef.nativeElement.offsetLeft,
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
"ng2-cookies": "^1.0.12",
|
"ng2-cookies": "^1.0.12",
|
||||||
"ng2-slim-loading-bar": "^4.0.0",
|
"ng2-slim-loading-bar": "^4.0.0",
|
||||||
"node-iptc": "^1.0.4",
|
"node-iptc": "^1.0.4",
|
||||||
"optimist": "^0.6.1",
|
|
||||||
"reflect-metadata": "^0.1.10",
|
"reflect-metadata": "^0.1.10",
|
||||||
"rxjs": "^5.4.1",
|
"rxjs": "^5.4.1",
|
||||||
"systemjs": "0.20.14",
|
"systemjs": "0.20.14",
|
||||||
@ -66,7 +65,6 @@
|
|||||||
"@types/gm": "^1.17.31",
|
"@types/gm": "^1.17.31",
|
||||||
"@types/jasmine": "^2.5.52",
|
"@types/jasmine": "^2.5.52",
|
||||||
"@types/node": "^8.0.1",
|
"@types/node": "^8.0.1",
|
||||||
"@types/optimist": "0.0.29",
|
|
||||||
"@types/sharp": "^0.17.2",
|
"@types/sharp": "^0.17.2",
|
||||||
"@types/winston": "^2.3.3",
|
"@types/winston": "^2.3.3",
|
||||||
"chai": "^4.0.2",
|
"chai": "^4.0.2",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user