1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-01-18 17:14:08 +01:00

fixed preview not working when filename has special characters

This commit is contained in:
TGS963 2023-04-29 15:01:33 +05:30
parent ca2a8cd780
commit 35f5ca01de

View File

@ -617,7 +617,7 @@ const Home = () => {
<img
src={
"file://" +
`${upscaledImagePath ? upscaledImagePath : imagePath}`
`${upscaledImagePath ? upscaledImagePath.replace(/([^/\\]+)$/i, encodeURIComponent(upscaledImagePath.match(/[^/\\]+$/i)[0])) : imagePath.replace(/([^/\\]+)$/i, encodeURIComponent(imagePath.match(/[^/\\]+$/i)[0]))}`
}
onLoad={(e: any) => {
setDimensions({
@ -674,7 +674,7 @@ const Home = () => {
</p>
<img
src={"file://" + imagePath}
src={"file:///" + imagePath.replace(/([^/\\]+)$/i, encodeURIComponent(imagePath.match(/[^/\\]+$/i)[0]))}
alt="Original"
onMouseMove={handleMouseMove}
style={{
@ -692,7 +692,7 @@ const Home = () => {
Upscayled
</p>
<img
src={"file://" + upscaledImagePath}
src={"file://" + upscaledImagePath.replace(/([^/\\]+)$/i, encodeURIComponent(upscaledImagePath.match(/[^/\\]+$/i)[0]))}
alt="Upscayl"
style={{
objectFit: "contain",