jimp-dev / jimp

An image processing library written entirely in JavaScript for Node, with zero external or native dependencies.
http://jimp-dev.github.io/jimp/
MIT License
14.07k stars 761 forks source link

LoadFont dont work! #1347

Open AndreZila01 opened 2 months ago

AndreZila01 commented 2 months ago

Previously, i was use your code when Jimp has on version ^0.22.10. But when i update the library i received that warning: "Cannot read properties of undefined (reading 'slice')". I would like know what happend to the library. And where i can found documentation of JIMP to JavaScript!

const Jimp = require('jimp');

async function load() {

    let content = "Test"

    await Jimp.loadFont(Jimp.FONT_SANS_128_WHITE).then(async (font) => {
        let count = 0;
        await Jimp.read(`./FicheirosS/1.JPG`).then(async (fir_img) => {

            fir_img.print(
                font,
                250,
                2000,
                content,
            );

            fir_img.write(`./FicheirosC/${count++}.JPG`);
        });
    });

}

load();

Thanks for the support!

AndreZila01 commented 2 months ago

Message of error i was received:

Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'slice') at isBinary (c:\Users\Andre\Desktop\Rita\AddFonte\node_modules\@jimp\plugin-print\dist\commonjs\load-bitmap-font.js:24:31) at parseFont (c:\Users\Andre\Desktop\Rita\AddFonte\node_modules\@jimp\plugin-print\dist\commonjs\load-bitmap-font.js:31:9) at loadBitmapFontData (c:\Users\Andre\Desktop\Rita\AddFonte\node_modules\@jimp\plugin-print\dist\commonjs\load-bitmap-font.js:103:16) at loadFont (c:\Users\Andre\Desktop\Rita\AddFonte\node_modules\@jimp\plugin-print\dist\commonjs\load-font.js:28:69) at processTicksAndRejections (/internal/process/task_queues:95:5)

FerdinandRamos commented 1 month ago

Did you figure out a solution to this? I'm having the same issue

AndreZila01 commented 1 month ago

Nooo... i'm using the old version number "^0.22.10"

isntfunny commented 3 days ago

Same issue here.. Any solutions?