Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JPEG: "Validation ended prematurely" #456

Closed
rgfeldman opened this issue Apr 29, 2019 · 9 comments
Closed

JPEG: "Validation ended prematurely" #456

rgfeldman opened this issue Apr 29, 2019 · 9 comments
Assignees
Labels
bug A product defect that needs fixing P1 High priority issues to be scheduled in the upcoming release

Comments

@rgfeldman
Copy link

I have a few jpeg files that were successfully validated with version 1.20, however they are unable to validate with the new version 1.22 (which comes with jpeg-hul-1.5.1.jar)., so this may be a new issue that was recently introduced.

JHOVE ended abruptly (never completed)

The output is below:
Apr 29, 2019 3:31:54 PM edu.harvard.hul.ois.jhove.JhoveBase process
SEVERE: Validation ended prematurely due to an unhandled exception.
java.lang.IllegalArgumentException: Cannot format given Object as a Number
at java.text.DecimalFormat.format(Unknown Source)
at java.text.Format.format(Unknown Source)
at java.text.MessageFormat.subformat(Unknown Source)
at java.text.MessageFormat.format(Unknown Source)
at java.text.Format.format(Unknown Source)
at java.text.MessageFormat.format(Unknown Source)
at edu.harvard.hul.ois.jhove.module.tiff.IFD.addIntegerProperty(IFD.java:417)
at edu.harvard.hul.ois.jhove.module.tiff.ExifIFD.getProperty(ExifIFD.java:513)
at edu.harvard.hul.ois.jhove.module.jpeg.JpegExif.readExifData(JpegExif.java:164)
at edu.harvard.hul.ois.jhove.module.JpegModule.readAPP1(JpegModule.java:1112)
at edu.harvard.hul.ois.jhove.module.JpegModule.parse(JpegModule.java:650)
at edu.harvard.hul.ois.jhove.JhoveBase.processFile(JhoveBase.java:788)
at edu.harvard.hul.ois.jhove.JhoveBase.process(JhoveBase.java:560)
at edu.harvard.hul.ois.jhove.JhoveBase.dispatch(JhoveBase.java:432)
at edu.harvard.hul.ois.jhove.viewer.JhoveWindow.openAndParse(JhoveWindow.java:618)
at edu.harvard.hul.ois.jhove.viewer.JhoveWindow.pickAndAnalyzeFile1(JhoveWindow.java:391)
at edu.harvard.hul.ois.jhove.viewer.JhoveWindow$ParseThread.run(JhoveWindow.java:877)

Can provide file that caused issue if requested.

@carlwilson
Copy link
Member

Hi @rgfeldman, thanks for reporting this. Please do send the sample as I think @tledoux has provided a fix and I'm testing/merging it. I have an example myself but would like to see if the fix covers this case.

@rgfeldman
Copy link
Author

This was a jpg rather than a tiff, and too big to send as an attachment

You should be able to access the file here:
https://drive.google.com/drive/folders/1AzSBbyNCmCpql5AAVWwHVBz4x1kxrKoT

@carlwilson carlwilson self-assigned this Oct 18, 2019
@carlwilson carlwilson added bug A product defect that needs fixing P1 High priority issues to be scheduled in the upcoming release labels Oct 18, 2019
@carlwilson carlwilson added this to the v1.24-m4 Release milestone Oct 18, 2019
@carlwilson
Copy link
Member

Hi @rgfeldman I believe that RC1.24 will fix this issue, please test and confirm as I can no longer access the test file.

@rgfeldman
Copy link
Author

rgfeldman commented Dec 11, 2019 via email

@carlwilson
Copy link
Member

Hi @rgfeldman this is a bug with a new feature #518, I'm going to get in touch with the developer and see about a new RC for early next week.

@carlwilson
Copy link
Member

Further to the above I see that the issue is caused by this problem: jetty/jetty.project#3244 so Java 9 has broken this. I think that it's fixable by using ByteUtils instead so will make the patch for Monday.

@carlwilson
Copy link
Member

And finally @rgfeldman is it OK to add this file to the JHOVE test set for regressions once this is fixed?

@carlwilson
Copy link
Member

Really finally (or I hope so on this issue) @rgfeldman I've now managed to fix this simply by rebuilding the RC using Java 8, you can download and test here: https://software.openpreservation.org/releases/jhove-installer-rc.jar

@ross-spencer
Copy link

hi @carlwilson I didn't have a better forum to ask without a new ticket - did 1.20 get released with a Java 8 build, or do you have any ideas why there might be different results on different machines? I'm seeing this in a 1.20 JHOVE and TIFF module. Before we head down the path of compiling in Java 8 I just wanted to see if a public release incorporated it.

$ jhove -h xml 001.jpg
Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
	at edu.harvard.hul.ois.jhove.NisoImageMetadata.extractIccProfileDescription(NisoImageMetadata.java:2223)
	at edu.harvard.hul.ois.jhove.module.JpegModule.readAPP2(JpegModule.java:1266)
	at edu.harvard.hul.ois.jhove.module.JpegModule.parse(JpegModule.java:621)
	at edu.harvard.hul.ois.jhove.JhoveBase.processFile(JhoveBase.java:795)
	at edu.harvard.hul.ois.jhove.JhoveBase.process(JhoveBase.java:585)
	at edu.harvard.hul.ois.jhove.JhoveBase.dispatch(JhoveBase.java:439)
	at Jhove.main(Jhove.java:295)

$ jhove -h xml *
Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
	at edu.harvard.hul.ois.jhove.NisoImageMetadata.extractIccProfileDescription(NisoImageMetadata.java:2223)
	at edu.harvard.hul.ois.jhove.module.tiff.TiffIFD.lookupTag(TiffIFD.java:3006)
	at edu.harvard.hul.ois.jhove.module.tiff.IFD.parse(IFD.java:320)
	at edu.harvard.hul.ois.jhove.module.tiff.IFD.parse(IFD.java:218)
	at edu.harvard.hul.ois.jhove.module.TiffModule.parseIFDChain(TiffModule.java:1115)
	at edu.harvard.hul.ois.jhove.module.TiffModule.parseIFDs(TiffModule.java:1089)
	at edu.harvard.hul.ois.jhove.module.TiffModule.parseIFDs(TiffModule.java:1053)
	at edu.harvard.hul.ois.jhove.module.TiffModule.parse(TiffModule.java:461)
	at edu.harvard.hul.ois.jhove.JhoveBase.processFile(JhoveBase.java:782)
	at edu.harvard.hul.ois.jhove.JhoveBase.process(JhoveBase.java:585)
	at edu.harvard.hul.ois.jhove.JhoveBase.dispatch(JhoveBase.java:439)
	at Jhove.main(Jhove.java:295)
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (build 1.8.0_275-8u275-b01-0ubuntu1~18.04-b01)
OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)
jhove -v
Jhove (Rel. 1.20.0, 2019-04-09)
 Date: 2020-12-22 16:04:16 UTC
 App:
  API: 1.20.0, 2019-04-09
  Configuration: /etc/jhove/jhove.conf
  JhoveHome: /users/stephen/projects/jhove
  Encoding: utf-8
  TempDirectory: /var/tmp
  BufferSize: 131072
  Module: AIFF-hul 1.4
  Module: ASCII-hul 1.3
  Module: BYTESTREAM 1.3
  Module: GIF-hul 1.3
  Module: HTML-hul 1.3
  Module: JPEG-hul 1.4
  Module: JPEG2000-hul 1.3
  Module: PDF-hul 1.11
  Module: TIFF-hul 1.8
  Module: UTF8-hul 1.6
  Module: WAVE-hul 1.6
  Module: XML-hul 1.4
  OutputHandler: Audit 1.1
  OutputHandler: TEXT 1.6
  OutputHandler: XML 1.8
  Usage: java JHOVE [-c config] [-m module] [-h handler] [-e encoding] [-H handler] [-o output] [-x saxclass] [-t tempdir] [-b bufsize] [-l loglevel] [[-krs] dir-file-or-uri [...]]
  Rights: Derived from software Copyright 2004-2011 by the President and Fellows of Harvard College. Version 1.7 to 1.11 independently released. Version 1.12 onwards released by Open Preservation Foundation. Released under the GNU Lesser General Public License.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A product defect that needs fixing P1 High priority issues to be scheduled in the upcoming release
Projects
None yet
Development

No branches or pull requests

3 participants