commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Bourg (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SANSELAN-19) JpegXMPWriter throws NullPointerException
Date Tue, 20 Dec 2011 10:49:30 GMT

     [ https://issues.apache.org/jira/browse/SANSELAN-19?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emmanuel Bourg updated SANSELAN-19:
-----------------------------------

    Fix Version/s: 1.0
    
> JpegXMPWriter throws NullPointerException
> -----------------------------------------
>
>                 Key: SANSELAN-19
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-19
>             Project: Commons Sanselan
>          Issue Type: Bug
>         Environment: Windows XP, JDK 1.5
>            Reporter: Kelly Boettcher
>             Fix For: 1.0
>
>         Attachments: TestJPG.jpg
>
>
> I am try to use the JpegXMPWriter to write xmp values from a Jpeg file. Using JpegImageParser,
I can retrieve existing xmp values out the file fine. However, attempting to write back into
the file produces an exception.
> byte[] b = null;
> String existingXMP = null;
> String newXMP = null;
> XMPMeta meta = null;
> Document licenseDoc = null;
> JpegImageParser parser = null;       
> JpegXmpRewriter xmpWriter = null;
> ByteArrayOutputStream baos = null;
> b = new byte[is.available()]; // is is a jpeg input stream passed into the function.
> is.read(b);
> is.close(); 
> parser = new JpegImageParser();
> ByteSourceArray bs = new ByteSourceArray(b);
> existingXMP = parser.getXmpXml(bs, null); // works fine, passes back valid xmp from the
file
> /* I did have other functionality here to manipulate the xmp which
>    works fine, but I also ran the test without changing the xmp,
>    with the same resulting exception. */
> baos = new ByteArrayOutputStream();            
> xmpWriter.updateXmpXml(bs, baos, existingXMP);  // NullPointerException occurs here.
> b = baos.toByteArray();
> is = new ByteArrayInputStream(b);
> return is;
> Exception produced: 
> java.lang.NullPointerException
> 	at au.gov.abs.manager.injector.jpeg.JPEGXMPInjector.doLicenseInsertionSan(JPEGXMPInjector.java:230)
> 	at au.gov.abs.manager.injector.jpeg.JPEGXMPInjector.doLicenseInsertionSan(JPEGXMPInjector.java:170)
> 	at au.gov.abs.manager.test.TestJPEGXMPInjector.testDoLicenseInsertionSan(TestJPEGXMPInjector.java:156)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
> 	at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
> 	at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
> 	at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
> 	at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
> 	at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
> 	at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
> 	at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
> 	at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
> 	at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message