mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Bugfix: No Image Upscale for Clips (#4569)
This commit is contained in:
@@ -855,6 +855,8 @@ export const LightboxComponent: React.FC<IProps> = ({
|
||||
{i >= currentIndex - 1 && i <= currentIndex + 1 ? (
|
||||
<LightboxImage
|
||||
src={image.paths.image ?? ""}
|
||||
width={image.visual_files?.[0]?.width ?? 0}
|
||||
height={image.visual_files?.[0]?.height ?? 0}
|
||||
displayMode={displayMode}
|
||||
scaleUp={lightboxSettings?.scaleUp ?? false}
|
||||
scrollMode={
|
||||
|
||||
@@ -52,6 +52,8 @@ function calculateDefaultZoom(
|
||||
|
||||
interface IProps {
|
||||
src: string;
|
||||
width: number;
|
||||
height: number;
|
||||
displayMode: GQL.ImageLightboxDisplayMode;
|
||||
scaleUp: boolean;
|
||||
scrollMode: GQL.ImageLightboxScrollMode;
|
||||
@@ -74,6 +76,8 @@ interface IProps {
|
||||
|
||||
export const LightboxImage: React.FC<IProps> = ({
|
||||
src,
|
||||
width,
|
||||
height,
|
||||
displayMode,
|
||||
scaleUp,
|
||||
scrollMode,
|
||||
@@ -94,8 +98,6 @@ export const LightboxImage: React.FC<IProps> = ({
|
||||
const [moving, setMoving] = useState(false);
|
||||
const [positionX, setPositionX] = useState(0);
|
||||
const [positionY, setPositionY] = useState(0);
|
||||
const [width, setWidth] = useState(0);
|
||||
const [height, setHeight] = useState(0);
|
||||
const [boxWidth, setBoxWidth] = useState(0);
|
||||
const [boxHeight, setBoxHeight] = useState(0);
|
||||
|
||||
@@ -135,24 +137,6 @@ export const LightboxImage: React.FC<IProps> = ({
|
||||
}, 250);
|
||||
}, [container]);
|
||||
|
||||
useEffect(() => {
|
||||
let mounted = true;
|
||||
const img = new Image();
|
||||
function onLoad() {
|
||||
if (mounted) {
|
||||
setWidth(img.width);
|
||||
setHeight(img.height);
|
||||
}
|
||||
}
|
||||
|
||||
img.onload = onLoad;
|
||||
img.src = src;
|
||||
|
||||
return () => {
|
||||
mounted = false;
|
||||
};
|
||||
}, [src]);
|
||||
|
||||
const minMaxY = useCallback(
|
||||
(appliedZoom: number) => {
|
||||
let minY, maxY: number;
|
||||
@@ -528,15 +512,6 @@ export const LightboxImage: React.FC<IProps> = ({
|
||||
}
|
||||
|
||||
const ImageView = isVideo ? "video" : "img";
|
||||
const customStyle = isVideo
|
||||
? {
|
||||
touchAction: "none",
|
||||
display: "flex",
|
||||
margin: "auto",
|
||||
width: "100%",
|
||||
"max-height": "90vh",
|
||||
}
|
||||
: { touchAction: "none" };
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -559,7 +534,7 @@ export const LightboxImage: React.FC<IProps> = ({
|
||||
src={src}
|
||||
alt=""
|
||||
draggable={false}
|
||||
style={customStyle}
|
||||
style={{ touchAction: "none" }}
|
||||
onWheel={current ? (e) => onImageScroll(e) : undefined}
|
||||
onMouseDown={onImageMouseDown}
|
||||
onMouseUp={onImageMouseUp}
|
||||
|
||||
Reference in New Issue
Block a user