@dotlottie/dotlottie-js
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -14,3 +14,3 @@ import { strToU8, zip, unzip, strFromU8 } from 'fflate'; | ||
name: "@dotlottie/dotlottie-js", | ||
version: "0.3.1", | ||
version: "0.3.2", | ||
type: "module", | ||
@@ -1188,5 +1188,4 @@ description: "This library helps in creating and modifying .lottie files.", | ||
const buffer = await this.toArrayBuffer(); | ||
let ret = Buffer.from(buffer).toString(); | ||
ret = `data:image/${this.fileName.split(".")[1] || "jpeg"};base64,${ret}`; | ||
return ret; | ||
const base64 = Buffer.from(buffer).toString("base64"); | ||
return `data:image/${this.fileName.split(".")[1] || "jpeg"};base64,${base64}`; | ||
} | ||
@@ -1377,2 +1376,3 @@ }; | ||
for (const key of Object.keys(contentObj)) { | ||
const decompressedFile = contentObj[key]; | ||
const decodedStr = strFromU8(contentObj[key], false); | ||
@@ -1398,8 +1398,8 @@ if (key.startsWith("animations/") && key.endsWith(".json")) { | ||
} | ||
let decodedImg = Buffer.from(decodedStr).toString("base64"); | ||
const ext = getExtensionTypeFromBase64(decodedImg); | ||
decodedImg = `data:image/${ext};base64,${decodedImg}`; | ||
const base64 = Buffer.from(decompressedFile).toString("base64"); | ||
const ext = getExtensionTypeFromBase64(base64); | ||
const imgDataURL = `data:image/${ext};base64,${base64}`; | ||
tmpImages.push(new LottieImage2({ | ||
id: imageId, | ||
data: decodedImg, | ||
data: imgDataURL, | ||
fileName: key.split("/")[1] || "" | ||
@@ -1406,0 +1406,0 @@ })); |
@@ -14,3 +14,3 @@ import { strToU8, zip, unzip, strFromU8 } from 'fflate'; | ||
name: "@dotlottie/dotlottie-js", | ||
version: "0.3.1", | ||
version: "0.3.2", | ||
type: "module", | ||
@@ -1195,5 +1195,4 @@ description: "This library helps in creating and modifying .lottie files.", | ||
const buffer = await this.toArrayBuffer(); | ||
let ret = Buffer.from(buffer).toString(); | ||
ret = `data:image/${this.fileName.split(".")[1] || "jpeg"};base64,${ret}`; | ||
return ret; | ||
const base64 = Buffer.from(buffer).toString("base64"); | ||
return `data:image/${this.fileName.split(".")[1] || "jpeg"};base64,${base64}`; | ||
} | ||
@@ -1384,2 +1383,3 @@ }; | ||
for (const key of Object.keys(contentObj)) { | ||
const decompressedFile = contentObj[key]; | ||
const decodedStr = strFromU8(contentObj[key], false); | ||
@@ -1405,8 +1405,8 @@ if (key.startsWith("animations/") && key.endsWith(".json")) { | ||
} | ||
let decodedImg = Buffer.from(decodedStr).toString("base64"); | ||
const ext = getExtensionTypeFromBase64(decodedImg); | ||
decodedImg = `data:image/${ext};base64,${decodedImg}`; | ||
const base64 = Buffer.from(decompressedFile).toString("base64"); | ||
const ext = getExtensionTypeFromBase64(base64); | ||
const imgDataURL = `data:image/${ext};base64,${base64}`; | ||
tmpImages.push(new LottieImage2({ | ||
id: imageId, | ||
data: decodedImg, | ||
data: imgDataURL, | ||
fileName: key.split("/")[1] || "" | ||
@@ -1413,0 +1413,0 @@ })); |
@@ -436,5 +436,4 @@ var __defProp = Object.defineProperty; | ||
const buffer = await this.toArrayBuffer(); | ||
let ret = Buffer.from(buffer).toString(); | ||
ret = `data:image/${this.fileName.split(".")[1] || "jpeg"};base64,${ret}`; | ||
return ret; | ||
const base64 = Buffer.from(buffer).toString("base64"); | ||
return `data:image/${this.fileName.split(".")[1] || "jpeg"};base64,${base64}`; | ||
} | ||
@@ -441,0 +440,0 @@ }; |
@@ -162,5 +162,4 @@ var __defProp = Object.defineProperty; | ||
const buffer = await this.toArrayBuffer(); | ||
let ret = Buffer.from(buffer).toString(); | ||
ret = `data:image/${this.fileName.split(".")[1] || "jpeg"};base64,${ret}`; | ||
return ret; | ||
const base64 = Buffer.from(buffer).toString("base64"); | ||
return `data:image/${this.fileName.split(".")[1] || "jpeg"};base64,${base64}`; | ||
} | ||
@@ -167,0 +166,0 @@ }; |
{ | ||
"name": "@dotlottie/dotlottie-js", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "This library helps in creating and modifying .lottie files.", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1071839
13399