Merge branch 'develop' into preview

This commit is contained in:
Michael Mayer 2022-02-07 12:41:24 +01:00
commit 98131359fc
14 changed files with 493 additions and 323 deletions

View file

@ -30,7 +30,7 @@
<link rel="manifest" href="{{ .config.ManifestUri }}" crossorigin="use-credentials">
<script>
window.__CONFIG__ = {{ .config }};
window.__CONFIG__ = {{ .config }};
</script>
</head>
<body class="{{ .config.Flags }}">

View file

@ -13,7 +13,7 @@
<link rel="manifest" href="{{ .config.ManifestUri }}" crossorigin="use-credentials">
<script>
window.__CONFIG__ = {{ .config }};
window.__CONFIG__ = {{ .config }};
</script>
</head>
<body class="{{ .config.Flags }}">

View file

@ -27,7 +27,7 @@
<link rel="manifest" href="{{ .config.ManifestUri }}" crossorigin="use-credentials">
<script>
window.__CONFIG__ = {{ .config }};
window.__CONFIG__ = {{ .config }};
</script>
</head>
<body class="shared {{ .config.Flags }}">

View file

@ -32,16 +32,12 @@
<link rel="manifest" href="{{ .config.ManifestUri }}" crossorigin="use-credentials">
<script>
window.__CONFIG__ = {{ .config }};
window.__CONFIG__ = {{ .config }};
</script>
<script async defer data-domain="{{ .config.SiteDomain }}" src="https://a.photoprism.app/js/plausible.js"></script>
<script async defer data-domain="{{ .config.SiteDomain }}" src="https://a.photoprism.app/js/s.js"></script>
</head>
<body class="{{ .config.Flags }}">
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade
your browser</a> to improve your experience.</p>
<![endif]-->
{{template "app.tmpl" .}}

File diff suppressed because it is too large Load diff

View file

@ -146,6 +146,122 @@ export default class Util {
start = now;
}
static codecName(value) {
if (!value || typeof value !== "string") {
return "";
}
switch (value) {
case "avc1":
return "Advanced Video Coding (AVC) / H.264";
case "hvc1":
return "High Efficiency Video Coding (HEVC) / H.265";
case "mjpg":
return "Motion JPEG (MJPEG)";
case "heic":
return "High Efficiency Image File Format (HEIC)";
case "1":
return "Uncompressed";
case "2":
return "CCITT 1D";
case "3":
return "T4/Group 3 Fax";
case "4":
return "T6/Group 4 Fax";
case "5":
return "LZW";
case "jpeg":
case "6":
case "7":
case "99":
return "JPEG";
case "8":
return "Adobe Deflate";
case "9":
return "JBIG B&W";
case "10":
return "JBIG Color";
case "262":
return "Kodak 262";
case "32766":
return "Next";
case "32767":
return "Sony ARW";
case "32769":
return "Packed RAW";
case "32770":
return "Samsung SRW";
case "32771":
return "CCIRLEW";
case "32772":
return "Samsung SRW 2";
case "32773":
return "PackBits";
case "32809":
return "Thunderscan";
case "32867":
return "Kodak KDC";
case "32895":
return "IT8CTPAD";
case "32896":
return "IT8LW";
case "32897":
return "IT8MP";
case "32898":
return "IT8BL";
case "32908":
return "PixarFilm";
case "32909":
return "PixarLog";
case "32946":
return "Deflate";
case "32947":
return "DCS";
case "33003":
return "Aperio JPEG 2000 YCbCr";
case "33005":
return "Aperio JPEG 2000 RGB";
case "34661":
return "JBIG";
case "34676":
return "SGILog";
case "34677":
return "SGILog24";
case "34712":
return "JPEG 2000";
case "34713":
return "Nikon NEF";
case "34715":
return "JBIG2 TIFF FX";
case "34718":
return "Microsoft DI Binary";
case "34719":
return "Microsoft DI Progressive";
case "34720":
return "Microsoft DI Vector";
case "34887":
return "ESRI Lerc";
case "34892":
return "Lossy JPEG";
case "34925":
return "LZMA2";
case "34926":
return "Zstd";
case "34927":
return "WebP";
case "34933":
return "PNG";
case "34934":
return "JPEG XR";
case "65000":
return "Kodak DCR";
case "65535":
return "Pentax PEF";
default:
return value.toUpperCase();
}
}
static async copyToMachineClipboard(text) {
if (window.navigator.clipboard) {
await window.navigator.clipboard.writeText(text);

View file

@ -155,18 +155,10 @@ main {
#photoprism .body-1,
#photoprism .body-2,
#photoprism .break-word,
#photoprism .v-datatable td,
#photoprism .v-card button,
#photoprism .v-card .caption {
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-word;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
#photoprism .break-word {
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-word;
@ -206,6 +198,36 @@ main {
line-height: 2.0rem !important;
}
/* Image Orientation */
.orientation-0 {
transform: rotate(0deg);
}
.orientation-1 {
transform: rotate(0deg);
}
.orientation-2 {
transform: rotate(0deg);
}
.orientation-3 {
transform: rotate(180deg);
}
.orientation-4 {
transform: rotate(180deg);
}
.orientation-5 {
transform: rotate(90deg);
}
.orientation-6 {
transform: rotate(90deg);
}
.orientation-7 {
transform: rotate(270deg);
}
.orientation-8 {
transform: rotate(270deg);
}
/* RTL alignments */
#photoprism.is-rtl .text-xs-left,

View file

@ -116,7 +116,7 @@
<td>
<translate>Codec</translate>
</td>
<td>{{ file.Codec | uppercase }}</td>
<td>{{ codecName(file) }}</td>
</tr>
<tr v-if="file.Primary">
<td>
@ -152,14 +152,14 @@
<td>
<translate>Aspect Ratio</translate>
</td>
<td>{{ file.AspectRatio }}</td>
<td>{{ file.AspectRatio }} : 1</td>
</tr>
<tr v-if="file.Orientation">
<td>
<translate>Orientation</translate>
</td>
<td>
<translate>{{ file.Orientation }}</translate>
<v-icon :class="`orientation-${file.Orientation}`">portrait</v-icon>
</td>
</tr>
<tr v-if="file.ColorProfile">
@ -178,7 +178,7 @@
<td>
<translate>Chroma</translate>
</td>
<td>{{ file.Chroma }} / 100</td>
<td><v-progress-linear :value="file.Chroma" style="max-width: 300px;" :title="`${file.Chroma}%`"></v-progress-linear></td>
</tr>
<tr v-if="file.Missing">
<td>
@ -226,6 +226,7 @@
import Thumb from "model/thumb";
import {DateTime} from "luxon";
import Notify from "../../common/notify";
import Util from "../../common/util";
export default {
name: 'PTabPhotoFiles',
@ -262,6 +263,13 @@ export default {
},
computed: {},
methods: {
codecName(file) {
if (!file || !file.Codec) {
return "";
}
return Util.codecName(file.Codec);
},
openFile(file) {
this.$viewer.show([Thumb.fromFile(this.model, file)], 0);
},

View file

@ -9,11 +9,6 @@ msgstr ""
msgid ""
msgstr ""
#: src/dialog/photo/files.vue:140
#: src/dialog/photo/files.vue:137
msgid "{{ file.Orientation }}"
msgstr ""
#: src/pages/albums.vue:342
#: src/share/albums.vue:300
msgid "%{n} albums found"
@ -683,7 +678,7 @@ msgstr ""
msgid "Details"
msgstr ""
#: src/dialog/photo/files.vue:31
#: src/dialog/photo/files.vue:32
msgid "Dimensions"
msgstr ""
@ -814,7 +809,7 @@ msgstr ""
#: src/component/photo/list.vue:58
#: src/component/photo/viewer.vue:158
#: src/component/subject/clipboard.vue:44
#: src/dialog/photo/files.vue:44
#: src/dialog/photo/files.vue:52
#: src/pages/library/files.vue:99
#: src/share/album/clipboard.vue:37
#: src/share/photo/cards.vue:54
@ -1517,7 +1512,7 @@ msgstr ""
#: src/dialog/album/edit.vue:106
#: src/dialog/photo/files.vue:71
#: src/dialog/photo/files.vue:68
#: src/dialog/photo/files.vue:30
#: src/dialog/photo/files.vue:31
#: src/dialog/photo/info.vue:31
#: src/dialog/photo/labels.vue:48
#: src/dialog/photo/people.vue:18
@ -1822,7 +1817,7 @@ msgstr ""
msgid "Permanently remove files to free up storage."
msgstr ""
#: src/model/photo.js:896
#: src/model/photo.js:904
msgid "Photo"
msgstr ""
@ -1921,7 +1916,7 @@ msgstr ""
#: src/dialog/photo/files.vue:101
#: src/dialog/photo/files.vue:32
#: src/dialog/photo/files.vue:98
#: src/dialog/photo/files.vue:24
#: src/dialog/photo/files.vue:25
msgid "Primary"
msgstr ""
@ -2266,7 +2261,7 @@ msgstr ""
#: src/dialog/account/edit.vue:220
#: src/dialog/photo/files.vue:83
#: src/dialog/photo/files.vue:80
#: src/dialog/photo/files.vue:32
#: src/dialog/photo/files.vue:33
msgid "Size"
msgstr ""
@ -2345,7 +2340,7 @@ msgstr ""
msgid "Static Size Limit: %{n}px"
msgstr ""
#: src/dialog/photo/files.vue:34
#: src/dialog/photo/files.vue:35
msgid "Status"
msgstr ""
@ -2491,7 +2486,7 @@ msgstr ""
#: src/dialog/account/edit.vue:490
#: src/dialog/photo/files.vue:89
#: src/dialog/photo/files.vue:86
#: src/dialog/photo/files.vue:33
#: src/dialog/photo/files.vue:34
#: src/dialog/photo/info.vue:15
msgid "Type"
msgstr ""
@ -2511,8 +2506,8 @@ msgstr ""
#: src/model/photo.js:588
#: src/model/photo.js:611
#: src/model/photo.js:625
#: src/model/photo.js:702
#: src/model/photo.js:715
#: src/model/photo.js:710
#: src/model/photo.js:723
#: src/options/options.js:20
#: src/options/options.js:34
#: src/options/options.js:51

View file

@ -69,9 +69,9 @@ export const DATE_FULL = {
export const DATE_FULL_TZ = {
year: num,
month: long,
month: short,
day: num,
weekday: long,
weekday: short,
hour: num,
minute: num,
timeZoneName: short,
@ -683,9 +683,17 @@ export class Photo extends RestModel {
let info = [];
if (this.Camera) {
info.push(this.Camera.Make + " " + this.Camera.Model);
if (this.Camera.Model.length > 7) {
info.push(this.Camera.Model);
} else {
info.push(this.Camera.Make + " " + this.Camera.Model);
}
} else if (this.CameraModel && this.CameraMake) {
info.push(this.CameraMake + " " + this.CameraModel);
if (this.CameraModel.length > 7) {
info.push(this.CameraModel);
} else {
info.push(this.CameraMake + " " + this.CameraModel);
}
}
let file = this.videoFile();

2
go.mod
View file

@ -35,7 +35,7 @@ require (
github.com/leonelquinteros/gotext v1.5.0
github.com/lib/pq v1.8.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0
github.com/mandykoh/prism v0.34.0
github.com/mandykoh/prism v0.34.1
github.com/manifoldco/promptui v0.9.0
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-sqlite3 v2.0.1+incompatible // indirect

4
go.sum
View file

@ -215,8 +215,8 @@ github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i
github.com/machinebox/progress v0.2.0/go.mod h1:hl4FywxSjfmkmCrersGhmJH7KwuKl+Ueq9BXkOny+iE=
github.com/mandykoh/go-parallel v0.1.0 h1:7vJMNMC4dsbgZdkAb2A8tV5ENY1v7VxIO1wzQWZoT8k=
github.com/mandykoh/go-parallel v0.1.0/go.mod h1:lkYHqG1JNTaSS6lG+PgFCnyMd2VDy8pH9jN9pY899ig=
github.com/mandykoh/prism v0.34.0 h1:BWwxhdTVMZxhSur2sDmkFFLKzD8mFXOMy6bjJ4WuS4k=
github.com/mandykoh/prism v0.34.0/go.mod h1:mqzyMed6kgs8cImi+RoXBi5YtuzmSWShTakMRMD94VE=
github.com/mandykoh/prism v0.34.1 h1:FXEp+vEbm50HNN+cEF+8SWIrph/sY/XotRbh5uBrGS8=
github.com/mandykoh/prism v0.34.1/go.mod h1:mqzyMed6kgs8cImi+RoXBi5YtuzmSWShTakMRMD94VE=
github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA=
github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg=
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=

View file

@ -21,7 +21,7 @@ type Data struct {
TakenAtLocal time.Time `meta:"DateTimeOriginal,CreationDate,CreateDate,MediaCreateDate,ContentCreateDate,DateTimeDigitized,DateTime"`
TimeZone string `meta:"-"`
Duration time.Duration `meta:"Duration,MediaDuration,TrackDuration"`
Codec string `meta:"CompressorID,Compression,FileType"`
Codec string `meta:"CompressorID,FileType"`
Title string `meta:"Title"`
Subject string `meta:"Subject,PersonInImage,ObjectName,HierarchicalSubject,CatalogSets"`
Keywords Keywords `meta:"Keywords"`

View file

@ -170,7 +170,7 @@ func TestJSON(t *testing.T) {
// t.Logf("DATA: %+v", data)
assert.Equal(t, CodecJpeg, data.Codec)
assert.Equal(t, CodecXMP, data.Codec)
assert.Equal(t, "", data.Title)
assert.Equal(t, "", data.Artist)
assert.Equal(t, "", data.Description)