blink-diff icon indicating copy to clipboard operation
blink-diff copied to clipboard

Return image buffer instead writing to output

Open Timmimim opened this issue 7 years ago • 2 comments

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

Timmimim avatar Aug 10 '17 11:08 Timmimim

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?

qrpike avatar Oct 24 '17 02:10 qrpike

@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

qrpike avatar Oct 24 '17 03:10 qrpike