tiff.js icon indicating copy to clipboard operation
tiff.js copied to clipboard

How to create multipage tif using tiff.js

Open somnathsutar opened this issue 10 years ago • 3 comments

How to create multipage tiff file using tiff.js at client side.?

somnathsutar avatar Jun 25 '14 07:06 somnathsutar

This port of libtiff was only made to read a tiff file and not meant to create multi-page tiff file. If you want to create tiff file in js you need to do another port of lib tiff by adding the function you needed.

alexandremottet avatar Jun 25 '14 18:06 alexandremottet

@Aleanar I don't get you on you above point. Could you elaborate more on that. So that I could start with implementation.

pankajparkar avatar Jun 02 '15 07:06 pankajparkar

I asked chat.openai.com how to make a html page that reads a TIFF file, makes some modifications, and creates a result. the AI told me to use libtiff.js from https://github.com/seikichi/libtiff.js. That URL gives an error, so I guess it means https://github.com/seikichi/tiff.js. It suggested this code, which does not seem to work:

    // Create new TIFF page
    var newTiff = new Tiff({buffer: new ArrayBuffer(0)});
    newTiff.setField(Tiff.Tag.IMAGEWIDTH, width);
    newTiff.setField(Tiff.Tag.IMAGELENGTH, height);
    newTiff.setField(Tiff.Tag.IMAGEDESCRIPTION, metadata);
    newTiff.writeRGBAImage(imageData);

Constructing a new Tiff from new ArrayBuffer(0) does not seem to work. Is the AI misleading me?

esigra avatar Jan 21 '23 22:01 esigra