1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-23 01:27:14 +02:00

Merge pull request #798 from nk9/image-titles-2

[#760] Add image titles and captions to the info panel.
This commit is contained in:
Patrik J. Braun 2023-12-13 09:53:09 +01:00 committed by GitHub
commit 3489f1d55a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 42 additions and 5 deletions

4
.gitignore vendored
View File

@ -1,3 +1,4 @@
.angular/
.idea/
PiGallery2.iml
node_modules/
@ -30,3 +31,6 @@ test.*
/test/cypress/screenshots/
/extensions/
/extension/lib/
*.sublime-project
*.sublime-workspace
.DS_Store

1
.tool-versions Normal file
View File

@ -0,0 +1 @@
nodejs 18.16.0

View File

@ -4,7 +4,8 @@
"schematicCollections": [
"@angular-eslint/schematics",
"@schematics/angular"
]
],
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",

View File

@ -86,6 +86,9 @@ export class MediaMetadataEntity implements MediaMetadata {
@Column('text')
caption: string;
@Column('text')
title?: string;
@Column(() => MediaDimensionEntity)
size: MediaDimensionEntity;

View File

@ -335,6 +335,9 @@ export class MetadataLoader {
.replace(/\0/g, '')
.trim();
}
if (iptcData.object_name) {
metadata.title = iptcData.object_name.replace(/\0/g, '').trim();
}
if (iptcData.caption) {
metadata.caption = iptcData.caption.replace(/\0/g, '').trim();
}

View File

@ -1,4 +1,4 @@
/**
* This version indicates that the sql/entities/*Entity.ts files got changed and the db needs to be recreated
*/
export const DataStructureVersion = 34;
export const DataStructureVersion = 35;

View File

@ -19,6 +19,8 @@ export interface MediaMetadata {
fileSize: number;
keywords?: string[];
rating?: RatingTypes;
title?: string;
caption?: string;
}
export interface MediaDimension {

View File

@ -27,6 +27,7 @@ export interface FaceRegion {
}
export interface PhotoMetadata extends MediaMetadata {
title?: string;
caption?: string;
cameraData?: CameraMetadata;
positionData?: PositionMetaData;

View File

@ -130,6 +130,7 @@ import {
ionContractOutline,
ionCopyOutline,
ionDocumentOutline,
ionDocumentTextOutline,
ionDownloadOutline,
ionExpandOutline,
ionFileTrayFullOutline,
@ -243,7 +244,7 @@ Marker.prototype.options.icon = MarkerFactory.defIcon;
ionAlbumsOutline, ionSettingsOutline, ionLogOutOutline,
ionChevronForwardOutline, ionChevronDownOutline, ionChevronBackOutline,
ionTrashOutline, ionSaveOutline, ionAddOutline, ionRemoveOutline,
ionTextOutline, ionFolderOutline, ionDocumentOutline, ionImageOutline,
ionTextOutline, ionFolderOutline, ionDocumentOutline, ionDocumentTextOutline, ionImageOutline,
ionPricetagOutline, ionLocationOutline,
ionSunnyOutline, ionMoonOutline, ionVideocamOutline,
ionInformationCircleOutline,

View File

@ -27,6 +27,10 @@
padding-right: 5px;
}
.caption-body {
white-space: pre-wrap;
}
.yaga-map {
width: 100%;
height: 100%;

View File

@ -4,6 +4,21 @@
<button type="button" class="btn-close" (click)="close()" aria-label="Close">
</button>
</div>
<div class="row" *ngIf="media.metadata.caption || media.metadata.title">
<div class="col-1 ps-0">
<ng-icon class="details-icon" name="ionDocumentTextOutline"></ng-icon>
</div>
<div class="col-11">
<h4 *ngIf="media.metadata.title">
{{media.metadata.title}}
</h4>
<div class="details-main" *ngIf="media.metadata.caption">
<div class="caption-body">{{media.metadata.caption}}</div>
</div>
</div>
</div>
<div class="row" *ngIf="contentLoaderService.isSearchResult()">
<div class="col-1 ps-0">
<ng-icon class="details-icon" name="ionFolderOutline"></ng-icon>

View File

@ -40,5 +40,6 @@
"size": {
"height": 7,
"width": 10
}
},
"title": "Bambi Title"
}

View File

@ -49,5 +49,6 @@
"size": {
"height": 10,
"width": 14
}
},
"title": "Test caption"
}