Skip to content

Segmentation fault #10

Description

@misterjt
var fs=require('fs');
var sys = require('util');
var Jpeg = require('jpeg').Jpeg;
var Buffer = require('buffer').Buffer;
fs.readFile("./jpeg-gradient.jpeg", function(error, rgba) { 
    console.log(error);
    console.log(rgba);
    var jpeg = new Jpeg(rgba, 720, 400, 'rgb');
    var jpeg_img = jpeg.encodeSync().toString('binary');
    fs.writeFileSync('./jpeg.jpeg', jpeg_img, 'binary');
})

Picture "./jpeg-gradient.jpeg" 100% exists.

This code return me

dima@Acer ~/api.chatster $ node photo.js
null
<Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ff db 00 43 00 0d 09 0a 0b 0a 08 0d 0b 0a 0b 0e 0e 0d 0f 13 20 15 13 12 12 13 27 1c 1e 17 20 ...>
Segmentation fault

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions