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

Fix Python runtime error #72

Merged
merged 3 commits into from
Dec 2, 2015
Merged

Fix Python runtime error #72

merged 3 commits into from
Dec 2, 2015

Conversation

stweil
Copy link
Contributor

@stweil stweil commented Oct 14, 2015

No description provided.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
@bitsgalore
Copy link
Member

Hi Stefan,

First of all many thanks for the patch! Could you perhaps supply a JP2 that produces the error you're reporting, as that would help me to review the patch.

BTW I'm in the middle of some major computer crisis at the moment (main development machine utterly fried), so it may take me a while to have a proper look at this.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This error was reported while validating some JP2 files:

Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/jpylyzer/jpylyzer.py",
       line 631, in <module>    main()
  File "/usr/local/lib/python3.2/dist-packages/jpylyzer/jpylyzer.py",
       line 627, in main    checkFiles(args.inputRecursiveFlag, args.inputWrapperFlag, jp2In)
  File "/usr/local/lib/python3.2/dist-packages/jpylyzer/jpylyzer.py",
       line 553, in checkFiles    xmlElement = checkOneFile(path)
  File "/usr/local/lib/python3.2/dist-packages/jpylyzer/jpylyzer.py",
       line 268, in checkOneFile    "JP2", fileData).validate()  # validateJP2(fileData)
  File "/usr/local/lib/python3.2/dist-packages/jpylyzer/boxvalidator.py",
       line 99, in validate    to_call()
  File "/usr/local/lib/python3.2/dist-packages/jpylyzer/boxvalidator.py",
       line 2255, in validate_JP2    boxType, boxContents).validate()
  File "/usr/local/lib/python3.2/dist-packages/jpylyzer/boxvalidator.py",
       line 99, in validate    to_call()
  File "/usr/local/lib/python3.2/dist-packages/jpylyzer/boxvalidator.py",
       line 1240, in validate_contiguousCodestreamBox
    if qStyle == 0:
UnboundLocalError: local variable 'qStyle' referenced before assignment

Signed-off-by: Stefan Weil <sw@weilnetz.de>
@stweil
Copy link
Contributor Author

stweil commented Oct 18, 2015

Hi Johan,

a test file is available from http://weilnetz.de/triggerUnboundLocalError.jp2.
It was created by kdu_compress from a TIFF file, but obviously the conversion failed.

I have now updated my patch, so jpylyzer can handle this file.

Stefan

@bitsgalore bitsgalore merged commit a3f9f17 into openpreserve:master Dec 2, 2015
@bitsgalore
Copy link
Member

Hi Stefan,

I finally merged your patch. One additional question: would you mind if I include your test file in the jpylyzer test corpus (link: https://github.com/openpreserve/jpylyzer-test-files)?

Thanks again!

Johan

@stweil
Copy link
Contributor Author

stweil commented Dec 2, 2015

Hi Johan,

you may do so - thanks for jpylyzer and your work. I'm glad if I can help a little bit.

Stefan

@bitsgalore
Copy link
Member

Thanks Stefan, I just added the file (with proper credit of course)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants