blink-diff
blink-diff copied to clipboard
Return image buffer instead writing to output
Hello there,
I am currently developing a tool that will automatically extract images from an HTML document as Buffers
, compare them, and create a 'diff-document' containing the output images from a blink-diff
comparison of images with equal index.
For performance reasons, it is not optimal for me to have blink-diff
write .png
-files, only for me to read them as Buffers
again.
However, I am for a while now failing to find a way to return the Output-Image as a Buffer
, or in any way get an output convertible to such.
Can you help me with that? That would be very much appreciated!
Kindest regards in advance, Timm Kühnel
with the o2r-project Institute for Geoinformation WWU Muenster, Germany
This would be very helpful. I also noticed the output.js
uses writeFileSync to actually write the file. Is there a reason this is not done async?
@Timmimim I just went ahead and forked it and made the necessary changes.
Here is the PR: https://github.com/yahoo/blink-diff/pull/44
Hope this helps