Closed stef-levesque closed 4 years ago
This is a cool feature. I haven't tested it yet but could you:
Thanks!
done
Thanks for the quick formatting fixes.
How have you been testing this? Building an image/data chunk and looking in a browser?
Is there an existing base64 encoder we can use in Foundation?
One thing I want to avoid is any sort of buffer overflow code in this simple utility.
I've been testing it by pasting the content into a Markdown and previewing it. Markdown can include image in base64. Ex.
![smallpng](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAALklEQVQI12P4//9/t+0rOMmAzOm2fcX4//9/BiTA0mP3moGBoeSQKITBBOHASQD5UyG73x3N2gAAAABJRU5ErkJggg==)
I can have a look at that API you linked. Is a requirement of macOS 10.9+
going to be an issue ?
I can have a look at that API you linked. Is a requirement of macOS 10.9+ going to be an issue ?
Looks like MacOS 10.9 was released in 2013, so that's fine, I think. The link was just one example - I'm not sure what is the best way.
You proposal is way less intrusive 😄
Oh great, that looks much cleaner!
Do you intend for base64 to only be supported for stdout? What if I tried pngpaste -b test.png
?
It will behave the same as pngpaste - test.png
, the file output is just ignored.
It wouldn't make sense to output to a .png
anyway, as this is a text string of base64 characters.
How I use it, mostly, is by :
pngpaste -b >> README.md
)pngpaste -b | pbcopy
)Yes, pbpaste -b test.png
wouldn't make much sense - perhaps pbpaste -b test.png.b64
or something. Either way, makes sense to me. Thanks for your PR!
Thanks!
Now available in 0.2.3! :tada: https://github.com/jcsalterego/pngpaste/releases/tag/0.2.3
Allows to output the png as a base64 encoded string. Flag: -b