yahoo/blink-diff

Return image buffer instead writing to output

Timmimim opened this issue · 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

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: #44

Hope this helps