mirror of
https://github.com/upscayl/upscayl.git
synced 2025-01-31 04:03:51 +01:00
fixed preview not working when filename has special characters
This commit is contained in:
parent
ca2a8cd780
commit
35f5ca01de
@ -617,7 +617,7 @@ const Home = () => {
|
|||||||
<img
|
<img
|
||||||
src={
|
src={
|
||||||
"file://" +
|
"file://" +
|
||||||
`${upscaledImagePath ? upscaledImagePath : imagePath}`
|
`${upscaledImagePath ? upscaledImagePath.replace(/([^/\\]+)$/i, encodeURIComponent(upscaledImagePath.match(/[^/\\]+$/i)[0])) : imagePath.replace(/([^/\\]+)$/i, encodeURIComponent(imagePath.match(/[^/\\]+$/i)[0]))}`
|
||||||
}
|
}
|
||||||
onLoad={(e: any) => {
|
onLoad={(e: any) => {
|
||||||
setDimensions({
|
setDimensions({
|
||||||
@ -674,7 +674,7 @@ const Home = () => {
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
src={"file://" + imagePath}
|
src={"file:///" + imagePath.replace(/([^/\\]+)$/i, encodeURIComponent(imagePath.match(/[^/\\]+$/i)[0]))}
|
||||||
alt="Original"
|
alt="Original"
|
||||||
onMouseMove={handleMouseMove}
|
onMouseMove={handleMouseMove}
|
||||||
style={{
|
style={{
|
||||||
@ -692,7 +692,7 @@ const Home = () => {
|
|||||||
Upscayled
|
Upscayled
|
||||||
</p>
|
</p>
|
||||||
<img
|
<img
|
||||||
src={"file://" + upscaledImagePath}
|
src={"file://" + upscaledImagePath.replace(/([^/\\]+)$/i, encodeURIComponent(upscaledImagePath.match(/[^/\\]+$/i)[0]))}
|
||||||
alt="Upscayl"
|
alt="Upscayl"
|
||||||
style={{
|
style={{
|
||||||
objectFit: "contain",
|
objectFit: "contain",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user