-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add URL Image Support #133
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do agree with direction of changes and functionality. But as it is it is cannot be accepted. For example change functions from sync to async is a breaking change for user. I would like to introduce new functions for that which perform async operation.
Also please leave whitespace changes outside of PR. if you want fix formatting, please do that in separate PR so we can discuss them separately.
|
||
// Perform a table substitution. May update `newTableRows` and `cells` and change `cell`. | ||
// Returns total number of new cells inserted on the original row. | ||
Workbook.prototype.substituteTable = function(row, newTableRows, cells, cell, namedTables, substitution, key, placeholder, drawing) { | ||
Workbook.prototype.substituteTable = async function(row, newTableRows, cells, cell, namedTables, substitution, key, placeholder, drawing) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is breaking change for consumers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do agree it's a breaking change , so you will need to upgrade library version, instead of creating new functions behaves exactly the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not this this addition is that critical, so all customers of this library should asyncify their code. For some of them this maybe a disruptive change. I prefer to have additional functions which handle async cases. Both of sync/async versions can share a lot internally.
@@ -561,20 +565,20 @@ module.exports = (function() { | |||
return rels; | |||
} | |||
//Load Drawing file | |||
Workbook.prototype.loadDrawing = function (sheet, sheetFilename, rels) { | |||
Workbook.prototype.loadDrawing = async function (sheet, sheetFilename, rels) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is breaking change for consumers.
May I know any update about imageURL? Is it available to use barcode api url? |
Finally, I copy 'substituteImage' to new function called 'substituteImgurl'. add-on this in function 'substitute'
Mainly modified for 'substituteImgurl' in order to directly put the buffer into 'substitutions' add-on 'substituteImgurl'
|
Added URL Image support ,
what i did basically is converting urls into base64 then the whole process works just fine , this is an async process so i had to change loops and functions calls using async/await method
Please Note that in index.js file this line is written in typescript ' import zip from "jszip" so i had to replace it in js '
And i added this library to the url convert 'image-to-base64'