Skip to content

Commit 90c22ae

Browse files
Merge pull request #2 from ScriptAddicts/remove-image-checks
Remove image checks
2 parents 0f51531 + 55adee3 commit 90c22ae

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
2-
dist
2+
dist
3+
.idea

src/apps/SpreadsheetApp/SpreadsheetAppp.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,16 @@
5555
insertImage(objAr_) {
5656
var ar, blob, dstSS, dstSheet, dstSheetId, e, requests, tmpId, tmpSheet, tmpSheetId, xlsxObj;
5757
if (!Array.isArray(objAr_) || (objAr_.some(({blob, range}) => {
58-
var height, identification, width;
58+
var identification;
5959
if (blob.toString() !== "Blob" || !range.row || !range.column || isNaN(range.row) || isNaN(range.column)) {
60+
console.log('[DocsServiceApp]', 'Issue with Blob or range coordinates')
6061
return true;
6162
}
62-
({width, height, identification} = ImgAppp.getSize(blob));
63-
if (width * height > 1048576) {
64-
return true;
65-
}
63+
({identification} = ImgAppp.getSize(blob));
6664
if (!(["GIF", "PNG", "JPG"].some((e) => {
6765
return e === identification;
6866
}))) {
67+
console.log('[DocsServiceApp]', 'Issue with file format', 'received', identification)
6968
return true;
7069
}
7170
return false;
@@ -84,7 +83,6 @@
8483
title: "SpreadsheetAppp_temp",
8584
mimeType: MimeType.GOOGLE_SHEETS
8685
}, blob).id;
87-
console.log(`LIB`, "TMP ID AFYTER INSER", tmpId);
8886
} catch (error) {
8987
e = error;
9088
console.log(`ERROR`, error);

0 commit comments

Comments
 (0)