adminizer 4.3.0-build.109 → 4.3.0-build.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -106,7 +106,7 @@ export class MediaManagerAdapter {
|
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
checkDirectory() {
|
|
109
|
-
const outputDir = `${this.manager.fileStoragePath}/${this.manager.urlPathPrefix}`;
|
|
109
|
+
const outputDir = `${process.cwd()}/${this.manager.fileStoragePath}/${this.manager.urlPathPrefix}`;
|
|
110
110
|
if (!fs.existsSync(outputDir)) {
|
|
111
111
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
112
112
|
}
|
|
@@ -4,6 +4,7 @@ import sizeOf from "image-size";
|
|
|
4
4
|
import sharp from "sharp";
|
|
5
5
|
import * as fs from 'fs';
|
|
6
6
|
import * as path from 'path';
|
|
7
|
+
import * as process from "node:process";
|
|
7
8
|
export class ImageItem extends File {
|
|
8
9
|
type = "image";
|
|
9
10
|
model = "mediamanagerap";
|
|
@@ -55,7 +56,7 @@ export class ImageItem extends File {
|
|
|
55
56
|
parent: null,
|
|
56
57
|
mimeType: file.mimetype,
|
|
57
58
|
size: file.size,
|
|
58
|
-
path:
|
|
59
|
+
path: `${this.fileStoragePath}/${this.urlPathPrefix}/${filename}`,
|
|
59
60
|
group: group,
|
|
60
61
|
tag: "origin",
|
|
61
62
|
filename: origFileName,
|
|
@@ -148,7 +149,7 @@ export class ImageItem extends File {
|
|
|
148
149
|
}
|
|
149
150
|
async resizeImage(input, output, width, height) {
|
|
150
151
|
// Get the directory from the output path
|
|
151
|
-
const outputDir = path.dirname(output)
|
|
152
|
+
const outputDir = `${process.cwd()}/${path.dirname(output)}`;
|
|
152
153
|
// Check if the directory exists, and create it if it doesn't
|
|
153
154
|
if (!fs.existsSync(outputDir)) {
|
|
154
155
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
@@ -209,7 +210,7 @@ export class TextItem extends ImageItem {
|
|
|
209
210
|
parent: null,
|
|
210
211
|
mimeType: file.mimetype,
|
|
211
212
|
size: file.size,
|
|
212
|
-
path:
|
|
213
|
+
path: `${this.fileStoragePath}/${filename}`,
|
|
213
214
|
group: group,
|
|
214
215
|
filename: origFileName,
|
|
215
216
|
tag: "origin",
|
package/package.json
CHANGED