1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 16:36:15 +00:00

fix rotate image path have Chinese charactors (#6898)

This commit is contained in:
Michael An
2024-10-14 20:33:29 +08:00
committed by GitHub
parent 78e5eaa478
commit 2a5d27e9de

View File

@@ -34,6 +34,7 @@ const ImagePreviewer = (props) => {
thumbnail: `${siteRoot}thumbnail/${repoID}/${thumbnailSizeForOriginal}${path}`,
src: src,
downloadURL: `${fileServerRoot}repos/${repoID}/files${path}/?op=download`,
rawPath: Utils.joinPath(parentDir, fileName),
};
});
setImageItems(newImageItems);
@@ -60,7 +61,7 @@ const ImagePreviewer = (props) => {
if (imageIndex >= 0 && angle !== 0) {
const repoID = window.sfMetadataContext.getSetting('repoID');
const imageItem = imageItems[imageIndex];
const path = imageItem.url.slice(imageItem.url.indexOf('/file/') + 5);
const path = imageItem.rawPath;
imageAPI.rotateImage(repoID, path, 360 - angle).then((res) => {
if (res.data?.success) {
seafileAPI.createThumbnail(repoID, path, thumbnailDefaultSize).then((res) => {