-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add loadImage opt.dataMode argument #1185
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
base: master
Are you sure you want to change the base?
Conversation
|
Hm actually... since this is meant to be the 100% browser-compatible API point, I'm not sure it should go there... @LinusU ? |
|
Hmmmm 🤔 Yeah, I'm not sure about adding it here since the goal was to be compatible with the browser. On the other hand, I'm not familiar enough with Is |
and PDFs are unique to node-canvas... I don't recall seeing anything similar to |
|
Ah, right, To be completely honest, I'm not sure why we have PDF-support in Canvas at all. It feels very shoehorned in and probably just added because it seemed easy. Without having done too much thinking/research, I think that I would love to get it out from the main API. Preferably out from the package at all, but at the very least extract out the PDF stuff to a separate API, possibly a subclass of I mean, if I'm thinking correct here, it doesn't even make sense at all to specify the Pages is another thing that works really strange at the moment. That is super specific to PDFs and doesn't make sense for Canvas at all. If anything, a PDF should be a collection of Canvases, where each Canvas represents one page. I'm very open to hearing other opinions, but I would love to get the PDF parts out from the main API, and instead have a dedicated API for it. Preferably, I would even put that in another package. |
|
On the other hand, it's convenient to have PDF support built-in (nice to have the same Context2D API to create PDFs or PNGs with just one line of code changed), it doesn't add any more dependencies, and I don't think it's too obtrusive. That is, the only non-standard APIs that it brings are What do you think of
The info is used when inserting the image, yes, but the implementation needs to know what to track when it still has the handle to the file/data being loaded into the Image. You can always track both, at the cost of performance/memory. |
|
@pravdomil sorry for the delay on this. #1402 just set us up nicely with a generic |
|
sorry, I cannot do that now
…On Wed, 24 Apr 2019 at 02:22, Zach Bjornson ***@***.***> wrote:
@pravdomil <https://github.com/pravdomil> sorry for the delay on this.
#1402 <#1402> just set us
up nicely with a generic options argument for loadImage(), which resolves
the above issue about browser compatibility. Do you feel like updating this
PR to follow the same pattern used in #1402
<#1402> please?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1185 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASG3HHDJPGSRW22Z73YLUDPR6Y4DANCNFSM4FGHTGIQ>
.
|
see diff