@tradly/asset 1.0.8 → 1.0.9
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.
|
@@ -32,6 +32,7 @@ var compressImage = function compressImage(file) {
|
|
|
32
32
|
quality = _ref$quality === void 0 ? 0.85 : _ref$quality,
|
|
33
33
|
_ref$convertPngToJpeg = _ref.convertPngToJpeg,
|
|
34
34
|
convertPngToJpeg = _ref$convertPngToJpeg === void 0 ? false : _ref$convertPngToJpeg;
|
|
35
|
+
console.log("compressImage", file, maxWidth, maxHeight, quality, convertPngToJpeg);
|
|
35
36
|
return new Promise(function (resolve) {
|
|
36
37
|
// Non-image or SVG: skip compression to avoid losing vector quality
|
|
37
38
|
if (!file.type.startsWith("image/") || file.type === "image/svg+xml") {
|
|
@@ -136,8 +137,8 @@ var FileUpload = function FileUpload(_ref2) {
|
|
|
136
137
|
_context.n = 2;
|
|
137
138
|
return Promise.all(fileList.map(function (file) {
|
|
138
139
|
return compressImage(file, {
|
|
139
|
-
maxWidth:
|
|
140
|
-
maxHeight:
|
|
140
|
+
maxWidth: 1300,
|
|
141
|
+
maxHeight: 1300,
|
|
141
142
|
quality: 0.85
|
|
142
143
|
});
|
|
143
144
|
}));
|
|
@@ -26,6 +26,7 @@ var compressImage = function compressImage(file) {
|
|
|
26
26
|
quality = _ref$quality === void 0 ? 0.85 : _ref$quality,
|
|
27
27
|
_ref$convertPngToJpeg = _ref.convertPngToJpeg,
|
|
28
28
|
convertPngToJpeg = _ref$convertPngToJpeg === void 0 ? false : _ref$convertPngToJpeg;
|
|
29
|
+
console.log("compressImage", file, maxWidth, maxHeight, quality, convertPngToJpeg);
|
|
29
30
|
return new Promise(function (resolve) {
|
|
30
31
|
// Non-image or SVG: skip compression to avoid losing vector quality
|
|
31
32
|
if (!file.type.startsWith("image/") || file.type === "image/svg+xml") {
|
|
@@ -130,8 +131,8 @@ var FileUpload = function FileUpload(_ref2) {
|
|
|
130
131
|
_context.n = 2;
|
|
131
132
|
return Promise.all(fileList.map(function (file) {
|
|
132
133
|
return compressImage(file, {
|
|
133
|
-
maxWidth:
|
|
134
|
-
maxHeight:
|
|
134
|
+
maxWidth: 1300,
|
|
135
|
+
maxHeight: 1300,
|
|
135
136
|
quality: 0.85
|
|
136
137
|
});
|
|
137
138
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradly/asset",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "A reusable media gallery component for uploading and selecting images, videos, and files with Tradly authentication",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|