#27 #66 #77 Add caption from image description metadata

This commit is contained in:
Alan Grainger
2025-05-05 12:25:30 +12:00
parent 4fd13219a6
commit fd73263cc1
8 changed files with 36 additions and 20 deletions
+4 -1
View File
@@ -7,9 +7,12 @@
"singleImageGallery": false,
"singleItemAutoOpen": true,
"downloadOriginalPhoto": true,
"showGalleryTitle": false,
"allowDownloadAll": 0,
"showHomePage": true,
"showGalleryTitle": false,
"showMetadata": {
"description": false
},
"customInvalidResponse": false
},
"lightGallery": {
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "immich-public-proxy",
"version": "1.9.1",
"version": "1.11.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "immich-public-proxy",
"version": "1.9.1",
"version": "1.11.0",
"license": "AGPL-3.0",
"dependencies": {
"archiver": "^7.0.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "immich-public-proxy",
"version": "1.10.0",
"version": "1.11.0",
"scripts": {
"dev": "ts-node src/index.ts",
"build": "npx tsc",
+1 -1
View File
@@ -122,7 +122,7 @@ class Render {
downloadUrl,
thumbnailUrl: baseUrl + immich.photoUrl(share.key, asset.id, ImageSize.thumbnail),
video,
description: asset?.exifInfo?.description ?? ''
description: getConfigOption('ipp.showMetadata.description', false) && typeof asset?.exifInfo?.description === 'string' ? asset.exifInfo.description : ''
})
}
res.render('gallery', {
+16 -10
View File
@@ -7,7 +7,7 @@
// Add an og-image using the first image's thumbnail
if (items?.[0]?.thumbnailUrl) {
%>
<meta property="og:image" content="<%- items[0].thumbnailUrl %>"/>
<meta property="og:image" content="<%- items[0].thumbnailUrl %>"/>
<% } %>
<link rel="icon" href="/share/static/favicon.ico" type="image/x-icon">
<link type="text/css" rel="stylesheet" href="/share/static/style.css"/>
@@ -21,22 +21,24 @@
<%
if (showDownload) {
%>
<div id="download-all">
<a href="<%- path %>/download" title="Download all"><img src="/share/static/images/download-all.svg"
height="24"
width="24" alt="Download all"></a>
</div>
<div id="download-all">
<a href="<%- path %>/download" title="Download all"><img src="/share/static/images/download-all.svg"
height="24"
width="24" alt="Download all"></a>
</div>
<% } %>
</div>
<div id="lightgallery">
<%
// Load the first 50 thumbnails, then load more as the user scrolls. See web.js
items.slice(0, 50).forEach(item => {
// Replace HTML entities for description text (if any)
item.description = item.description.replace(/'/g, '&apos;')
if (item.video) { %>
<a data-video='<%- item.video %>'
<% if (item.description) { %>
data-sub-html='<p><%= item.description %></p>'
<% } %>
<% } %>
<% if (item.downloadUrl) { %>
data-download-url="<%- item.downloadUrl %>"
<% } %>
@@ -48,7 +50,7 @@
<a href="<%- item.previewUrl %>"
<% if (item.description) { %>
data-sub-html='<p><%= item.description %></p>'
<% } %>
<% } %>
<% if (item.downloadUrl) { %>
data-download-url="<%- item.downloadUrl %>"
<% } %>
@@ -65,8 +67,12 @@
<script src="/share/static/lg/lg-video.min.js"></script>
<script src="/share/static/lg/lg-zoom.min.js"></script>
<script type="text/javascript">
lgallery.init(<%- JSON.stringify({lgConfig, items, openItem}) %>) // initLightGallery imported from web.js
<% if (openItem) { %>
lgallery.init(<%- JSON.stringify({
lgConfig,
items,
openItem
}) %>) // initLightGallery imported from web.js
<% if (openItem) { %>
const openItem = <%- openItem %>
const thumbs = document.querySelectorAll('#lightgallery a')
if (thumbs.length >= openItem) {