Skip to content

When a bitmap comes from readFile rotate crashes #4

@abepetrillo

Description

@abepetrillo

Given the following code:

var ImageJS = require('imagejs');

var bitmap = new ImageJS.Bitmap();

bitmap.readFile('image.png')
    .then(function() {
        // bitmap is ready
        var rotated = bitmap.rotate({degrees: -10, fit: 'crop'});
        bitmap.writeFile("rotated-image.png", {type: ImageJS.ImageType.PNG})
    });

I get an error:

Unhandled rejection TypeError: Cannot read property 'data' of undefined
    at module.exports (...node_modules/imagejs/lib/bitmap.js:46:46)

Not sure if I'm using the tool as intended, but was referencing the readme.

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