Skip to content
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

Image#src=Buffer works as setter, returns "" as getter #118

Open
csosborn opened this issue Sep 23, 2011 · 6 comments
Open

Image#src=Buffer works as setter, returns "" as getter #118

csosborn opened this issue Sep 23, 2011 · 6 comments
Labels

Comments

@csosborn
Copy link

I'm not actually sure how this should behave, but it seems reasonable that if I set an image src to be a buffer, getting src should then return the same or an equivalent buffer. Instead, it returns an empty string. Is this a bug or a feature?

@tj
Copy link
Contributor

tj commented Sep 23, 2011

i'd say a bug, it could be a bit of a gotcha in some situations to return the Buffer, but we definitely need some way to access it

@lukejagodzinski
Copy link

I have the same problem with getting buffer from Image but I see that 4 years later it's still not resolved :(

@saschagehlich
Copy link
Contributor

This is still the case. Also when setting a base64-encoded string as src.

@zbjornson zbjornson added the Bug label Sep 7, 2018
@cloudsoh
Copy link

In the setter(lib/image.js).
Why not just put val to every usage of setSource's third parameter?

@zbjornson
Copy link
Collaborator

@cloudsoh that works. My main concern with fixing this issue is that it increases memory usage for a somewhat unusual use case (and one that has workarounds) if we have to store a Buffer instance or data: URL for the lifetime of the image...

@FanaticFalcon
Copy link

Any news regarding this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants