mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Ensure that height gets set in the image request
Request quality of 96, for up to 16 less jpeg
This commit is contained in:
parent
6253942498
commit
9429f335b9
1 changed files with 12 additions and 16 deletions
|
@ -498,7 +498,7 @@ import ServerConnections from '../ServerConnections';
|
||||||
let imgUrl = null;
|
let imgUrl = null;
|
||||||
let imgTag = null;
|
let imgTag = null;
|
||||||
let coverImage = false;
|
let coverImage = false;
|
||||||
let uiAspect = null;
|
let uiAspect = getDesiredAspect(shape);
|
||||||
let imgType = null;
|
let imgType = null;
|
||||||
let itemId = null;
|
let itemId = null;
|
||||||
|
|
||||||
|
@ -543,11 +543,8 @@ import ServerConnections from '../ServerConnections';
|
||||||
forceName = true;
|
forceName = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (primaryImageAspectRatio) {
|
if (primaryImageAspectRatio && uiAspect) {
|
||||||
uiAspect = getDesiredAspect(shape);
|
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
|
||||||
if (uiAspect) {
|
|
||||||
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (item.SeriesPrimaryImageTag) {
|
} else if (item.SeriesPrimaryImageTag) {
|
||||||
imgType = 'Primary';
|
imgType = 'Primary';
|
||||||
|
@ -563,11 +560,8 @@ import ServerConnections from '../ServerConnections';
|
||||||
forceName = true;
|
forceName = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (primaryImageAspectRatio) {
|
if (primaryImageAspectRatio && uiAspect) {
|
||||||
uiAspect = getDesiredAspect(shape);
|
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
|
||||||
if (uiAspect) {
|
|
||||||
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (item.ParentPrimaryImageTag) {
|
} else if (item.ParentPrimaryImageTag) {
|
||||||
imgType = 'Primary';
|
imgType = 'Primary';
|
||||||
|
@ -579,11 +573,8 @@ import ServerConnections from '../ServerConnections';
|
||||||
itemId = item.AlbumId;
|
itemId = item.AlbumId;
|
||||||
height = width && primaryImageAspectRatio ? Math.round(width / primaryImageAspectRatio) : null;
|
height = width && primaryImageAspectRatio ? Math.round(width / primaryImageAspectRatio) : null;
|
||||||
|
|
||||||
if (primaryImageAspectRatio) {
|
if (primaryImageAspectRatio && uiAspect) {
|
||||||
uiAspect = getDesiredAspect(shape);
|
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
|
||||||
if (uiAspect) {
|
|
||||||
coverImage = (Math.abs(primaryImageAspectRatio - uiAspect) / uiAspect) <= 0.2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (item.Type === 'Season' && item.ImageTags && item.ImageTags.Thumb) {
|
} else if (item.Type === 'Season' && item.ImageTags && item.ImageTags.Thumb) {
|
||||||
imgType = 'Thumb';
|
imgType = 'Thumb';
|
||||||
|
@ -613,10 +604,15 @@ import ServerConnections from '../ServerConnections';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (imgTag && imgType) {
|
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, {
|
imgUrl = apiClient.getScaledImageUrl(itemId, {
|
||||||
type: imgType,
|
type: imgType,
|
||||||
fillHeight: height,
|
fillHeight: height,
|
||||||
fillWidth: width,
|
fillWidth: width,
|
||||||
|
quality: 96,
|
||||||
tag: imgTag
|
tag: imgTag
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue