mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #2514 from oddstr13/image-fill-resize
Add support for fillWidth and fillHeight
This commit is contained in:
commit
2c85b7806b
5 changed files with 11 additions and 9 deletions
|
@ -446,7 +446,7 @@ class AppRouter {
|
||||||
|
|
||||||
normalizeImageOptions(options) {
|
normalizeImageOptions(options) {
|
||||||
let setQuality;
|
let setQuality;
|
||||||
if (options.maxWidth || options.width || options.maxHeight || options.height) {
|
if (options.maxWidth || options.width || options.maxHeight || options.height || options.fillWidth || options.fillHeight) {
|
||||||
setQuality = true;
|
setQuality = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -615,8 +615,8 @@ import ServerConnections from '../ServerConnections';
|
||||||
if (imgTag && imgType) {
|
if (imgTag && imgType) {
|
||||||
imgUrl = apiClient.getScaledImageUrl(itemId, {
|
imgUrl = apiClient.getScaledImageUrl(itemId, {
|
||||||
type: imgType,
|
type: imgType,
|
||||||
maxHeight: height,
|
fillHeight: height,
|
||||||
maxWidth: width,
|
fillWidth: width,
|
||||||
tag: imgTag
|
tag: imgTag
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,12 +76,13 @@ import ServerConnections from '../ServerConnections';
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getImageUrl(item, width) {
|
function getImageUrl(item, size) {
|
||||||
const apiClient = ServerConnections.getApiClient(item.ServerId);
|
const apiClient = ServerConnections.getApiClient(item.ServerId);
|
||||||
let itemId;
|
let itemId;
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
maxWidth: width,
|
fillWidth: size,
|
||||||
|
fillHeight: size,
|
||||||
type: 'Primary'
|
type: 'Primary'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -105,10 +106,11 @@ import ServerConnections from '../ServerConnections';
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getChannelImageUrl(item, width) {
|
function getChannelImageUrl(item, size) {
|
||||||
const apiClient = ServerConnections.getApiClient(item.ServerId);
|
const apiClient = ServerConnections.getApiClient(item.ServerId);
|
||||||
const options = {
|
const options = {
|
||||||
maxWidth: width,
|
fillWidth: size,
|
||||||
|
fillHeight: size,
|
||||||
type: 'Primary'
|
type: 'Primary'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ function backdropImageUrl(apiClient, item, options) {
|
||||||
options.type = options.type || 'Backdrop';
|
options.type = options.type || 'Backdrop';
|
||||||
|
|
||||||
// If not resizing, get the original image
|
// If not resizing, get the original image
|
||||||
if (!options.maxWidth && !options.width && !options.maxHeight && !options.height) {
|
if (!options.maxWidth && !options.width && !options.maxHeight && !options.height && !options.fillWidth && !options.fillHeight) {
|
||||||
options.quality = 100;
|
options.quality = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ function getBackdropImageUrl(item, options, apiClient) {
|
||||||
options.type = options.type || 'Backdrop';
|
options.type = options.type || 'Backdrop';
|
||||||
|
|
||||||
// If not resizing, get the original image
|
// If not resizing, get the original image
|
||||||
if (!options.maxWidth && !options.width && !options.maxHeight && !options.height) {
|
if (!options.maxWidth && !options.width && !options.maxHeight && !options.height && !options.fillWidth && !options.fillHeight) {
|
||||||
options.quality = 100;
|
options.quality = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue