@christianriedl/media 1.0.48 → 1.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iMedia.d.ts +8 -8
- package/dist/iMedia.js +8 -8
- package/dist/iMedia.js.map +1 -1
- package/package.json +1 -1
- package/src/views/PhotoAlbumPage.vue +32 -32
package/dist/iMedia.d.ts
CHANGED
|
@@ -10,14 +10,14 @@ export declare enum EMediaType {
|
|
|
10
10
|
}
|
|
11
11
|
export declare enum EPictureQuality {
|
|
12
12
|
Full = 0,
|
|
13
|
-
Normal60 =
|
|
14
|
-
Normal80 =
|
|
15
|
-
Normal90 =
|
|
16
|
-
Normal100 =
|
|
17
|
-
High60 =
|
|
18
|
-
High80 =
|
|
19
|
-
High90 =
|
|
20
|
-
High100 =
|
|
13
|
+
Normal60 = 1060,
|
|
14
|
+
Normal80 = 1080,
|
|
15
|
+
Normal90 = 1090,
|
|
16
|
+
Normal100 = 1100,
|
|
17
|
+
High60 = 2060,
|
|
18
|
+
High80 = 2080,
|
|
19
|
+
High90 = 2090,
|
|
20
|
+
High100 = 2100
|
|
21
21
|
}
|
|
22
22
|
export interface IMediaAppConfig {
|
|
23
23
|
pictureQuality: EPictureQuality;
|
package/dist/iMedia.js
CHANGED
|
@@ -12,14 +12,14 @@ export var EMediaType;
|
|
|
12
12
|
export var EPictureQuality;
|
|
13
13
|
(function (EPictureQuality) {
|
|
14
14
|
EPictureQuality[EPictureQuality["Full"] = 0] = "Full";
|
|
15
|
-
EPictureQuality[EPictureQuality["Normal60"] =
|
|
16
|
-
EPictureQuality[EPictureQuality["Normal80"] =
|
|
17
|
-
EPictureQuality[EPictureQuality["Normal90"] =
|
|
18
|
-
EPictureQuality[EPictureQuality["Normal100"] =
|
|
19
|
-
EPictureQuality[EPictureQuality["High60"] =
|
|
20
|
-
EPictureQuality[EPictureQuality["High80"] =
|
|
21
|
-
EPictureQuality[EPictureQuality["High90"] =
|
|
22
|
-
EPictureQuality[EPictureQuality["High100"] =
|
|
15
|
+
EPictureQuality[EPictureQuality["Normal60"] = 1060] = "Normal60";
|
|
16
|
+
EPictureQuality[EPictureQuality["Normal80"] = 1080] = "Normal80";
|
|
17
|
+
EPictureQuality[EPictureQuality["Normal90"] = 1090] = "Normal90";
|
|
18
|
+
EPictureQuality[EPictureQuality["Normal100"] = 1100] = "Normal100";
|
|
19
|
+
EPictureQuality[EPictureQuality["High60"] = 2060] = "High60";
|
|
20
|
+
EPictureQuality[EPictureQuality["High80"] = 2080] = "High80";
|
|
21
|
+
EPictureQuality[EPictureQuality["High90"] = 2090] = "High90";
|
|
22
|
+
EPictureQuality[EPictureQuality["High100"] = 2100] = "High100";
|
|
23
23
|
})(EPictureQuality || (EPictureQuality = {}));
|
|
24
24
|
export var EItemType;
|
|
25
25
|
(function (EItemType) {
|
package/dist/iMedia.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iMedia.js","sourceRoot":"","sources":["../src/iMedia.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,UASX;AATD,WAAY,UAAU;IAClB,6CAAS,CAAA;IACT,6CAAS,CAAA;IACT,iDAAW,CAAA;IACX,4CAAS,CAAA;IACT,0DAAgB,CAAA;IAChB,iDAAa,CAAA;IACb,6CAAW,CAAA;IACX,mDAAc,CAAA;AAClB,CAAC,EATW,UAAU,KAAV,UAAU,QASrB;AACD,MAAM,CAAN,IAAY,eAUX;AAVD,WAAY,eAAe;IACvB,qDAAiB,CAAA;IACjB,
|
|
1
|
+
{"version":3,"file":"iMedia.js","sourceRoot":"","sources":["../src/iMedia.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,UASX;AATD,WAAY,UAAU;IAClB,6CAAS,CAAA;IACT,6CAAS,CAAA;IACT,iDAAW,CAAA;IACX,4CAAS,CAAA;IACT,0DAAgB,CAAA;IAChB,iDAAa,CAAA;IACb,6CAAW,CAAA;IACX,mDAAc,CAAA;AAClB,CAAC,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AAyC,CAAA;IACzC,gEAAwC,CAAA;IACxC,wDAAoC,CAAA;IACpC,0DAAqC,CAAA;IACrC,wDAAqB,CAAA;IACrB,uDAA+C,CAAA;IAC/C,qDAAgB,CAAA;IAChB,yCAAU,CAAA;AACd,CAAC,EApDW,SAAS,KAAT,SAAS,QAoDpB;AACD,MAAM,CAAN,IAAY,MAUX;AAVD,WAAY,MAAM;IACd,mCAAQ,CAAA;IACR,yDAAsB,CAAA;IACtB,2CAAe,CAAA;IACf,+CAAiB,CAAA;IACjB,qDAAoB,CAAA;IACpB,kDAAkB,CAAA;IAClB,sDAAoB,CAAA;IACpB,0DAAsB,CAAA;IACtB,+DAAwB,CAAA;AAC5B,CAAC,EAVW,MAAM,KAAN,MAAM,QAUjB;AA+CD,MAAM,CAAN,IAAY,YAQX;AARD,WAAY,YAAY;IAEpB,+CAAQ,CAAA;IACR,qDAAW,CAAA;IACX,6DAAe,CAAA;IACf,uDAAY,CAAA;IACZ,2DAAc,CAAA;IACd,yDAAa,CAAA;AACjB,CAAC,EARW,YAAY,KAAZ,YAAY,QAQvB"}
|
package/package.json
CHANGED
|
@@ -61,8 +61,7 @@
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
url.value = photos.Url;
|
|
64
|
-
buildUrls();
|
|
65
|
-
//onInput(0); required für v-carousel ?
|
|
64
|
+
//buildUrls();
|
|
66
65
|
}
|
|
67
66
|
else {
|
|
68
67
|
nextTick(() => router.back());
|
|
@@ -76,25 +75,43 @@
|
|
|
76
75
|
window.document.removeEventListener('keydown', onKey);
|
|
77
76
|
});
|
|
78
77
|
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
const item = items[i];
|
|
82
|
-
if (item.realUrl && item.realUrl.startsWith('blob'))
|
|
83
|
-
window.URL.revokeObjectURL(item.realUrl);
|
|
84
|
-
item.realUrl = getUrl(item);
|
|
85
|
-
}
|
|
78
|
+
function getQuality(pictureQuality: EPictureQuality) {
|
|
79
|
+
return pictureQuality % 1000;
|
|
86
80
|
}
|
|
87
|
-
function
|
|
88
|
-
const pictureQuality = mediaAppConfig.pictureQuality;
|
|
89
|
-
const quality = pictureQuality % 1000;
|
|
81
|
+
function getFactor(pictureQuality: EPictureQuality) {
|
|
90
82
|
let factor = Math.floor(pictureQuality / 1000);
|
|
91
83
|
if (factor > 1 && appState.pixelRatio > 1)
|
|
92
84
|
factor = appState.pixelRatio;
|
|
85
|
+
return factor;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function getUrl(item: IPictureFile) {
|
|
89
|
+
const pictureQuality = mediaAppConfig.pictureQuality;
|
|
90
|
+
const quality = getQuality(pictureQuality);
|
|
91
|
+
const factor = getFactor(pictureQuality);
|
|
93
92
|
if (landscape.value)
|
|
94
93
|
return mediaService.getPhotoUrl(url.value, item.Url, `${0}x${height.value * factor}x${item.Orientation}x${quality}`);
|
|
95
94
|
else
|
|
96
95
|
return mediaService.getPhotoUrl(url.value, item.Url, `${width.value * factor}x${0}x${item.Orientation}x${quality}`);
|
|
97
96
|
}
|
|
97
|
+
function getHeight(item: IPictureFile) {
|
|
98
|
+
const pictureQuality = mediaAppConfig.pictureQuality;
|
|
99
|
+
const factor = getFactor(pictureQuality);
|
|
100
|
+
if (pictureQuality == EPictureQuality.Full || factor > 1) {
|
|
101
|
+
if (landscape.value)
|
|
102
|
+
return height.value;
|
|
103
|
+
}
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
function getWidth(item: IPictureFile) {
|
|
107
|
+
const pictureQuality = mediaAppConfig.pictureQuality;
|
|
108
|
+
const factor = getFactor(pictureQuality);
|
|
109
|
+
if (pictureQuality == EPictureQuality.Full || factor > 1) {
|
|
110
|
+
if (!landscape.value)
|
|
111
|
+
return width.value;
|
|
112
|
+
}
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
98
115
|
function showMap(ev: Event) {
|
|
99
116
|
const current = items[index.value];
|
|
100
117
|
window.history.replaceState(null, "", `${appConfig.urlPrefix}photoalbum?id=${folderId}&start=${current.DLNAID}`);
|
|
@@ -105,16 +122,6 @@
|
|
|
105
122
|
}
|
|
106
123
|
});
|
|
107
124
|
}
|
|
108
|
-
function onInput(idx: number) {
|
|
109
|
-
idx++;
|
|
110
|
-
if (idx < items.length) {
|
|
111
|
-
const item = items[idx];
|
|
112
|
-
mediaService.getImage(item.realUrl!)
|
|
113
|
-
.then(blob => {
|
|
114
|
-
item.realUrl = window.URL.createObjectURL(blob);
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
125
|
function onDblClick(ev: Event) {
|
|
119
126
|
keyDialog.value = true;
|
|
120
127
|
}
|
|
@@ -146,7 +153,7 @@
|
|
|
146
153
|
}
|
|
147
154
|
else {
|
|
148
155
|
const mainEle = window.document.getElementsByTagName('main')[0];
|
|
149
|
-
mainEle.requestFullscreen();
|
|
156
|
+
await mainEle.requestFullscreen();
|
|
150
157
|
}
|
|
151
158
|
break;
|
|
152
159
|
case "KeyP":
|
|
@@ -189,13 +196,6 @@
|
|
|
189
196
|
onKey(keyEvent);
|
|
190
197
|
}
|
|
191
198
|
}
|
|
192
|
-
function itemWidth(item: IPictureFile): number {
|
|
193
|
-
const fac = item.Height / height.value;
|
|
194
|
-
return Math.floor(item.Width * fac);
|
|
195
|
-
}
|
|
196
|
-
function aspectRatio(item: IPictureFile): string {
|
|
197
|
-
return `${item.Width}/${item.Height}`;
|
|
198
|
-
}
|
|
199
199
|
function setMetaData(exif: Dictionary<any>, file: IPictureFile) {
|
|
200
200
|
origUrl = mediaService.getPhotoUrl(url.value, file.Url, '0x0x0');
|
|
201
201
|
metadata['Name'] = file.Name;
|
|
@@ -294,9 +294,9 @@
|
|
|
294
294
|
<v-container fluid :style="heightStyle" class="bg-grey-darken-3">
|
|
295
295
|
<v-carousel hide-delimiters :show-arrows="false" v-model="index"
|
|
296
296
|
:width="width" :height="height" :cycle="cycle" :interval="interval"
|
|
297
|
-
@
|
|
297
|
+
@dblclick="onDblClick">
|
|
298
298
|
<v-carousel-item v-for="item in items" :key="item.DLNAID">
|
|
299
|
-
<img :src="item.
|
|
299
|
+
<img :src="getUrl(item)" :alt="item.Name" :width="getWidth(item)" :height="getHeight(item)" />
|
|
300
300
|
</v-carousel-item>
|
|
301
301
|
</v-carousel>
|
|
302
302
|
<v-dialog v-model="infoDialog" :fullscreen="isMobile" >
|