diff --git a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html b/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html index 40efd715..9e2a9a1b 100644 --- a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html +++ b/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html @@ -1,30 +1,30 @@
-
+

Info

-
+
-
+
{{photo.name}}
-
{{photo.metadata.size.width}} x {{photo.metadata.size.height}}
-
{{calcMpx()}}MP
-
{{calcFileSize()}}
+
{{photo.metadata.size.width}} x {{photo.metadata.size.height}}
+
{{calcMpx()}}MP
+
{{calcFileSize()}}
-
+
-
+
{{getDate()}} @@ -32,43 +32,43 @@
-
{{getDay()}}, {{getTime()}}
+
{{getDay()}}, {{getTime()}}
-
+
-
+
{{photo.metadata.cameraData.model || photo.metadata.cameraData.make || "Camera"}}
-
ISO{{photo.metadata.cameraData.ISO}}
-
f/{{photo.metadata.cameraData.fStop}}
-
+
ISO{{photo.metadata.cameraData.ISO}}
+
f/{{photo.metadata.cameraData.fStop}}
+
{{toFraction(photo.metadata.cameraData.exposure)}}s
-
+
{{photo.metadata.cameraData.focalLength}}mm
-
{{photo.metadata.cameraData.lens}}
+
{{photo.metadata.cameraData.lens}}
-
+
-
+
{{getPositionText() || "Position"}}
-
+
{{photo.metadata.positionData.GPSData.latitude.toFixed(3)}}, {{photo.metadata.positionData.GPSData.longitude.toFixed(3)}}
diff --git a/frontend/app/gallery/lightbox/lightbox.gallery.component.html b/frontend/app/gallery/lightbox/lightbox.gallery.component.html index 0816a2c8..16dac073 100644 --- a/frontend/app/gallery/lightbox/lightbox.gallery.component.html +++ b/frontend/app/gallery/lightbox/lightbox.gallery.component.html @@ -7,13 +7,13 @@ -
scroll to there - if (this.getBodyScrollTop() > to.top || this.getBodyScrollTop() + this.getScreenHeight() < to.top) { + if (this.getBodyScrollTop() > to.top || this.getBodyScrollTop() + this.getPhotoFrameHeight() < to.top) { this.setBodyScrollTop(to.top); } @@ -150,8 +149,8 @@ export class GalleryLightboxComponent implements OnDestroy { { top: 0, left: 0, - width: this.getScreenWidth(), - height: this.getScreenHeight() + width: this.getPhotoFrameWidth(), + height: this.getPhotoFrameHeight() }); @@ -177,8 +176,8 @@ export class GalleryLightboxComponent implements OnDestroy { this.animateLightbox({ top: 0, left: 0, - width: this.getScreenWidth(), - height: this.getScreenHeight() + width: this.getPhotoFrameWidth(), + height: this.getPhotoFrameHeight() }, lightboxDimension).onDone(() => { this.visible = false; @@ -206,8 +205,8 @@ export class GalleryLightboxComponent implements OnDestroy { animateLightbox(from: Dimension = { top: 0, left: 0, - width: this.getScreenWidth(), - height: this.getScreenHeight() + width: this.getPhotoFrameWidth(), + height: this.getPhotoFrameHeight() }, to: Dimension = from): AnimationPlayer { const elem = this._builder.build([ style(Dimension.toString(from)), @@ -289,14 +288,14 @@ export class GalleryLightboxComponent implements OnDestroy { this.animateLightbox({ top: 0, left: 0, - width: this.getScreenWidth() + 400, - height: this.getScreenHeight() + width: this.getPhotoFrameWidth() + 400, + height: this.getPhotoFrameHeight() }, { top: 0, left: 0, - width: this.getScreenWidth(), - height: this.getScreenHeight() + width: this.getPhotoFrameWidth(), + height: this.getPhotoFrameHeight() }); if (this.iPvisibilityTimer != null) { clearTimeout(this.iPvisibilityTimer); @@ -319,14 +318,14 @@ export class GalleryLightboxComponent implements OnDestroy { this.animateLightbox({ top: 0, left: 0, - width: this.getScreenWidth() - 400, - height: this.getScreenHeight() + width: this.getPhotoFrameWidth() - 400, + height: this.getPhotoFrameHeight() }, { top: 0, left: 0, - width: this.getScreenWidth(), - height: this.getScreenHeight() + width: this.getPhotoFrameWidth(), + height: this.getPhotoFrameHeight() }); } } @@ -340,11 +339,11 @@ export class GalleryLightboxComponent implements OnDestroy { window.scrollTo(window.scrollX, value); } - private getScreenWidth() { + private getPhotoFrameWidth() { return Math.max(window.innerWidth - this.infoPanelWidth, 0); } - private getScreenHeight() { + private getPhotoFrameHeight() { return window.innerHeight; } @@ -352,15 +351,17 @@ export class GalleryLightboxComponent implements OnDestroy { private calcLightBoxPhotoDimension(photo: PhotoDTO): Dimension { let width = 0; let height = 0; - if (photo.metadata.size.height > photo.metadata.size.width) { - width = Math.round(photo.metadata.size.width * (this.getScreenHeight() / photo.metadata.size.height)); - height = this.getScreenHeight(); + const photoAspect = photo.metadata.size.width / photo.metadata.size.height; + const windowAspect = this.getPhotoFrameWidth() / this.getPhotoFrameHeight(); + if (photoAspect < windowAspect) { + width = Math.round(photo.metadata.size.width * (this.getPhotoFrameHeight() / photo.metadata.size.height)); + height = this.getPhotoFrameHeight(); } else { - width = this.getScreenWidth(); - height = Math.round(photo.metadata.size.height * (this.getScreenWidth() / photo.metadata.size.width)); + width = this.getPhotoFrameWidth(); + height = Math.round(photo.metadata.size.height * (this.getPhotoFrameWidth() / photo.metadata.size.width)); } - let top = (this.getScreenHeight() / 2 - height / 2); - let left = (this.getScreenWidth() / 2 - width / 2); + let top = (this.getPhotoFrameHeight() / 2 - height / 2); + let left = (this.getPhotoFrameWidth() / 2 - width / 2); return {top: top, left: left, width: width, height: height}; } @@ -385,6 +386,7 @@ export class GalleryLightboxComponent implements OnDestroy { this.controllersDimmed = false; }; + public pause() { if (this.timerSub != null) { this.timerSub.unsubscribe(); @@ -393,7 +395,6 @@ export class GalleryLightboxComponent implements OnDestroy { } public play() { - console.log("play"); this.pause(); this.timerSub = this.timer.filter(t => t % 2 == 0).subscribe(() => { if (this.navigation.hasNext) { @@ -406,7 +407,6 @@ export class GalleryLightboxComponent implements OnDestroy { } public fastForward() { - console.log("fastForward"); this.pause(); this.timerSub = this.timer.subscribe(() => { if (this.navigation.hasNext) { diff --git a/frontend/app/gallery/lightbox/photo/photo.lightbox.gallery.component.ts b/frontend/app/gallery/lightbox/photo/photo.lightbox.gallery.component.ts index 2f4d7a0b..d3e2027b 100644 --- a/frontend/app/gallery/lightbox/photo/photo.lightbox.gallery.component.ts +++ b/frontend/app/gallery/lightbox/photo/photo.lightbox.gallery.component.ts @@ -10,6 +10,7 @@ export class GalleryLightboxPhotoComponent implements OnChanges { @Input() gridPhoto: GridPhoto; @Input() loadImage: boolean = false; + @Input() windowAspect: number = 1; public imageSize = {width: "auto", height: "100"}; @@ -29,7 +30,10 @@ export class GalleryLightboxPhotoComponent implements OnChanges { return; } - if (this.gridPhoto.photo.metadata.size.height > this.gridPhoto.photo.metadata.size.width) { + + const photoAspect = this.gridPhoto.photo.metadata.size.width / this.gridPhoto.photo.metadata.size.height; + + if (photoAspect < this.windowAspect) { this.imageSize.height = "100"; this.imageSize.width = null; } else {