0 Replies Latest reply: Jun 8, 2010 4:34 AM by 843802 RSS

    create private tiff tags


      after an intensive search on how to create private tiff tags using JAI (ImagIO) libaries i'm now able to create my own tags. But if i'm using the snippet below all my tags are "unknown" to different applications. Of course i can re-read the tags using the number but not the name. Is there any way to set the name correctly too?
                     TIFFDirectory tiffDir = TIFFDirectory.createFromMetadata(reader.getImageMetadata(0));
                     IIOMetadata meta = tiffDir.getAsMetadata();
                     String[] _value = { "test tag 1!" };
                     TIFFTag tag=new TIFFTag("Test1", 65222, (1 << TIFFTag.TIFF_ASCII));
                     TIFFField sub=new TIFFField(tag,TIFFTag.TIFF_ASCII , 1, _value );
                     String[] value2 = { "test tag 2!" };
                     TIFFTag tag2=new TIFFTag("Test2",33000,(1 << TIFFTag.TIFF_ASCII));
                     TIFFField sub2=new TIFFField(tag2,TIFFTag.TIFF_ASCII,1,value2 );
                     IIOImage iioImage = new IIOImage(inputImg, null, meta);
                     writer.write(null, iioImage, writeParam);
      By the way, is it possible to set private tiff tags using the com.sun.media.jai.codec package? With this package i'm only able to read/modify existing tags ...