mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #2593 from oddstr13/pr-imagefix-master
Ensure that fillHeight gets set on image requests
(cherry picked from commit 5c09077a2f
)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
21fd1a96fe
commit
7af38bb60c
3 changed files with 14148 additions and 17 deletions
14135
package-lock.json
generated
Normal file
14135
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -64,7 +64,7 @@
|
|||
"headroom.js": "^0.12.0",
|
||||
"hls.js": "^0.14.17",
|
||||
"intersection-observer": "^0.12.0",
|
||||
"jellyfin-apiclient": "^1.6.0",
|
||||
"jellyfin-apiclient": "^1.7.0",
|
||||
"jquery": "^3.5.1",
|
||||
"jstree": "^3.3.10",
|
||||
"libarchive.js": "^1.3.0",
|
||||
|
|
|
@ -498,7 +498,7 @@ import ServerConnections from '../ServerConnections';
|
|||
let imgUrl = null;
|
||||
let imgTag = null;
|
||||
let coverImage = false;
|
||||
let uiAspect = null;
|
||||
const uiAspect = getDesiredAspect(shape);
|
||||
let imgType = null;
|
||||
let itemId = null;
|
||||
|
||||
|
@ -543,11 +543,8 @@ import ServerConnections from '../ServerConnections';
|
|||
forceName = true;
|
||||
}
|
||||
|
||||
if (primaryImageAspectRatio) {
|
||||
uiAspect = getDesiredAspect(shape);
|
||||
if (uiAspect) {
|
||||
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
|
||||
}
|
||||
if (primaryImageAspectRatio && uiAspect) {
|
||||
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
|
||||
}
|
||||
} else if (item.SeriesPrimaryImageTag) {
|
||||
imgType = 'Primary';
|
||||
|
@ -563,11 +560,8 @@ import ServerConnections from '../ServerConnections';
|
|||
forceName = true;
|
||||
}
|
||||
|
||||
if (primaryImageAspectRatio) {
|
||||
uiAspect = getDesiredAspect(shape);
|
||||
if (uiAspect) {
|
||||
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
|
||||
}
|
||||
if (primaryImageAspectRatio && uiAspect) {
|
||||
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
|
||||
}
|
||||
} else if (item.ParentPrimaryImageTag) {
|
||||
imgType = 'Primary';
|
||||
|
@ -579,11 +573,8 @@ import ServerConnections from '../ServerConnections';
|
|||
itemId = item.AlbumId;
|
||||
height = width && primaryImageAspectRatio ? Math.round(width / primaryImageAspectRatio) : null;
|
||||
|
||||
if (primaryImageAspectRatio) {
|
||||
uiAspect = getDesiredAspect(shape);
|
||||
if (uiAspect) {
|
||||
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
|
||||
}
|
||||
if (primaryImageAspectRatio && uiAspect) {
|
||||
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
|
||||
}
|
||||
} else if (item.Type === 'Season' && item.ImageTags && item.ImageTags.Thumb) {
|
||||
imgType = 'Thumb';
|
||||
|
@ -613,10 +604,15 @@ import ServerConnections from '../ServerConnections';
|
|||
}
|
||||
|
||||
if (imgTag && imgType) {
|
||||
// TODO: This place is a mess. Could do with a good spring cleaning.
|
||||
if (!height && width && uiAspect) {
|
||||
height = width / uiAspect;
|
||||
}
|
||||
imgUrl = apiClient.getScaledImageUrl(itemId, {
|
||||
type: imgType,
|
||||
fillHeight: height,
|
||||
fillWidth: width,
|
||||
quality: 96,
|
||||
tag: imgTag
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue