Giter Site home page Giter Site logo

Comments (7)

machawk1 avatar machawk1 commented on May 26, 2024

The image content is corrupted as compared to an Archive-It WARC. Something's not write in the JS code that is storing the image data. Encoding, maybe?

from warcreate.

machawk1 avatar machawk1 commented on May 26, 2024

Hex 89 is becoming hex EFBFBD. This sounds waaay too familiar, like a BOM issue.

from warcreate.

machawk1 avatar machawk1 commented on May 26, 2024

Part of the problem is that the call to fetch the image data via Ajax has required synchronicity for string building. Otherwise an arraybuffer or a Blob (see https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data ) could be used, except the W3C spec says that with these data types must be fetched via Ajax using async.

from warcreate.

machawk1 avatar machawk1 commented on May 26, 2024

See http://stackoverflow.com/questions/21708000/acquring-raw-image-data-when-fetching-image-using-ajax

from warcreate.

machawk1 avatar machawk1 commented on May 26, 2024

An alternative might be to try to capture the image data using the Chrome facilities when it first comes in but the response handlers don't seem to have access to this data.

from warcreate.

machawk1 avatar machawk1 commented on May 26, 2024

Woo, created a basis solution! Now, to scale it.

var hexValue = 0x89;
var png = "PNG";

var hexValueArrayBuffer = new ArrayBuffer(1);
var hexValueInt8Ary = new Int8Array(hexValueArrayBuffer);
hexValueInt8Ary[0] = hexValue;

var blob = new Blob([hexValueInt8Ary,png]);
saveAs(blob,"out.txt");

from warcreate.

machawk1 avatar machawk1 commented on May 26, 2024

Content length is now correct for simple case (mkdc) but not for large cases (e.g., CNN.com, FB)

from warcreate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.