Skip to content

Commit

Permalink
Merge pull request #120 from DDMAL/storeImages-fix
Browse files Browse the repository at this point in the history
fix: avoid text content being stored as image
  • Loading branch information
kunfang98927 authored Jul 12, 2024
2 parents 3945969 + 926d5a4 commit 808dc75
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Editor/ImageTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export class ImageTools {
// Image Handler Functions
storeImages(inputImgHeader: string, body: any[]) {
body.forEach((row, rowIndex) => {
const base64Image = row[inputImgHeader];
if (base64Image) {
this.getImageDimensions(base64Image).then(([width, height]) => {
const value = row[inputImgHeader];
if (value && (value.includes('http') || value.includes('base64'))) {
this.getImageDimensions(value).then(([width, height]) => {
this.images.push({
image: base64Image,
image: value,
width,
height,
row: rowIndex,
Expand Down

0 comments on commit 808dc75

Please sign in to comment.