Skip to main content

Multipage Tiff Exception

2 replies [Last post]
bhadfield
Offline
Joined: 2004-01-26

Any help with the NullPointerException would be greatly appreciated. I'm running this on jdk 1.5.0_03-b07.

Exception in thread "main" java.lang.NullPointerException
at com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriter.writeHeader(TIFFImageWriter.java:1993)
at com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriter.prepareWriteSequence(TIFFImageWriter.java:2239)
at pps.test.misc.ImageTest.testMultipage(ImageTest.java:34)
at pps.test.misc.ImageTest.main(ImageTest.java:47)

___________________________________

Here is the code that produces it:

public void testMultipage()
{
Iterator writerIter = ImageIO.getImageWritersByFormatName("tiff");

this.assertTrue(writerIter.hasNext());

ImageWriter writer = (ImageWriter) writerIter.next();

this.assertNotNull(writer);

try {
//get defaults just in case it helps.....?
ImageWriteParam writeParam = writer.getDefaultWriteParam();
IIOMetadata iiomd = writer.getDefaultStreamMetadata(writeParam);

if (writer.canWriteSequence()) {
writer.prepareWriteSequence(iiomd);
}
}
catch (IOException ex) {
ex.printStackTrace();
}

System.out.println("Test Complete");

}

Other details

_______________________________________

JAI Core:
Implementation-Version: 1.1.2_01
Specification-Version: 1.1-mr

JAI image io:
Specification-Version: 1.0-mr
Implementation-Title: com.sun.media.imageio
Implementation-Version: 1.0_01

I'm really stuck here.

Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Brian Burkhalter

You should check out also the sample code I just posted under the topic "Tiff
Exception".

Brian

On Fri, 11 Nov 2005, jai-interest@javadesktop.org wrote:

> Any help with the NullPointerException would be greatly appreciated. I'm running this on jdk 1.5.0_03-b07.
>
> Exception in thread "main" java.lang.NullPointerException
> at com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriter.writeHeader(TIFFImageWriter.java:1993)
> at com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriter.prepareWriteSequence(TIFFImageWriter.java:2239)
> at pps.test.misc.ImageTest.testMultipage(ImageTest.java:34)
> at pps.test.misc.ImageTest.main(ImageTest.java:47)
>
>
> ___________________________________
>
> Here is the code that produces it:
>
>
>
> public void testMultipage()
> {
> Iterator writerIter = ImageIO.getImageWritersByFormatName("tiff");
>
> this.assertTrue(writerIter.hasNext());
>
> ImageWriter writer = (ImageWriter) writerIter.next();
>
> this.assertNotNull(writer);
>
> try {
> //get defaults just in case it helps.....?
> ImageWriteParam writeParam = writer.getDefaultWriteParam();
> IIOMetadata iiomd = writer.getDefaultStreamMetadata(writeParam);
>
> if (writer.canWriteSequence()) {
> writer.prepareWriteSequence(iiomd);
> }
> }
> catch (IOException ex) {
> ex.printStackTrace();
> }
>
> System.out.println("Test Complete");
>
> }
>
> Other details
>
> _______________________________________
>
> JAI Core:
> Implementation-Version: 1.1.2_01
> Specification-Version: 1.1-mr
>
> JAI image io:
> Specification-Version: 1.0-mr
> Implementation-Title: com.sun.media.imageio
> Implementation-Version: 1.0_01
>
> I'm really stuck here.
>
> Thanks.
> ---
> [Message sent by forum member 'bhadfield' (Brad Hadfield)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=124445&#124445
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

----------------
Brian Burkhalter
Java Multimedia, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Brian Burkhalter

Would you post a complete test case please, not a snippet?

Thanks,

Brian

On Fri, 11 Nov 2005, jai-interest@javadesktop.org wrote:

> Any help with the NullPointerException would be greatly appreciated. I'm running this on jdk 1.5.0_03-b07.
>
> Exception in thread "main" java.lang.NullPointerException
> at com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriter.writeHeader(TIFFImageWriter.java:1993)
> at com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriter.prepareWriteSequence(TIFFImageWriter.java:2239)
> at pps.test.misc.ImageTest.testMultipage(ImageTest.java:34)
> at pps.test.misc.ImageTest.main(ImageTest.java:47)
>
>
> ___________________________________
>
> Here is the code that produces it:
>
>
>
> public void testMultipage()
> {
> Iterator writerIter = ImageIO.getImageWritersByFormatName("tiff");
>
> this.assertTrue(writerIter.hasNext());
>
> ImageWriter writer = (ImageWriter) writerIter.next();
>
> this.assertNotNull(writer);
>
> try {
> //get defaults just in case it helps.....?
> ImageWriteParam writeParam = writer.getDefaultWriteParam();
> IIOMetadata iiomd = writer.getDefaultStreamMetadata(writeParam);
>
> if (writer.canWriteSequence()) {
> writer.prepareWriteSequence(iiomd);
> }
> }
> catch (IOException ex) {
> ex.printStackTrace();
> }
>
> System.out.println("Test Complete");
>
> }
>
> Other details
>
> _______________________________________
>
> JAI Core:
> Implementation-Version: 1.1.2_01
> Specification-Version: 1.1-mr
>
> JAI image io:
> Specification-Version: 1.0-mr
> Implementation-Title: com.sun.media.imageio
> Implementation-Version: 1.0_01
>
> I'm really stuck here.
>
> Thanks.
> ---
> [Message sent by forum member 'bhadfield' (Brad Hadfield)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=124445&#124445
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

----------------
Brian Burkhalter
Java Multimedia, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net