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

J2K codec issue on Windows Mobile #77

Closed
gcode-importer opened this issue Aug 2, 2011 · 2 comments
Closed

J2K codec issue on Windows Mobile #77

gcode-importer opened this issue Aug 2, 2011 · 2 comments

Comments

@gcode-importer
Copy link

Originally reported on Google Code with ID 77

What steps will reproduce the problem?
1. Decoding a JP2K image on Windows Mobile
2. Display of bitmap on Windows Mobile

What is the expected output? What do you see instead?
  The source file are available under "test_original.j2k" and "test_changed.j2k"

  The screenshot of the image displayed on mobile is "j2k_sliced.png"

  The expected output image should be the face of a man but it appears in two parts
shifted, cut in two and sliced. 


What version of the product are you using? On what operating system?
I am working on Windows Mobile 6 OS and using the OpenJPEG-1.4.0-revision-697 library.



Please provide any additional information below.

A discussion on this issue has already started, see http://groups.google.com/group/openjpeg/browse_thread/thread/d97c7fdc1aeda0b0

The first part of the JP2K header of the file "test_changed.j2k" has been removed to
match the OpenJPEG format requirement.
The same image is correctly decoded on WindowsXP machine. Other kind of JPEG 2000 image
are correctly decoded on Windows Mobile. 

Thank you for your help.

Reported by matthias.arnaud on 2011-08-02 12:24:42


- _Attachment: j2k_sliced.png
![j2k_sliced.png](https://storage.googleapis.com/google-code-attachments/openjpeg/issue-77/comment-0/j2k_sliced.png)_ - _Attachment: [test_original.j2k](https://storage.googleapis.com/google-code-attachments/openjpeg/issue-77/comment-0/test_original.j2k)_ - _Attachment: [test_changed.j2k](https://storage.googleapis.com/google-code-attachments/openjpeg/issue-77/comment-0/test_changed.j2k)_
@gcode-importer
Copy link
Author

I have tested these files and found, that the original file
is broken. It does not start with a J2K MAGIC but with a
JP2 MAGIC. What follows is junk.

--------------------------------------------------------
#define JP2_RFC3745_MAGIC "\x00\x00\x00\x0c\x6a\x50\x20\x20\x0d\x0a\x87\x0a"
#define JP2_MAGIC "\x0d\x0a\x87\x0a"
#define J2K_CODESTREAM_MAGIC "\xff\x4f\xff\x51"

------------------ test_original -----------------------
read_j2k:

NOT A J2K FILE: test_original.j2k

0x00,0x00,0x00,0x0c, <== JP2_RFC3745_MAGIC part1
0x6a,0x50,0x20,0x20, <== JP2_RFC3745_MAGIC part2
0x0d,0x0a,0x87,0x0a, <== JP2_RFC3745_MAGIC part3

0x00,0x00,0x00,0xff, <== box_len

0x00,0x00,0x00,0x00, <== box_name



read_jp2:

NAME(test_original.j2k)
LENG(2963)

BOX_NAME(OÿQ) BOX_LEN(255)
BOX_NAME(^O~X,^_) BOX_LEN(2898778123)

The first box_name should be 'ftyp' (0x66,0x74,0x79,0x70)
e.g. :

NAME(file2.jp2)
LENG(452004)

BOX_NAME(ftyp) BOX_LEN(24)
   brand(jp2 ) minv(0)
   CL[0]()
   CL[1](jp2 )
BOX_NAME(jp2h) BOX_LEN(73)
BOX_NAME(ihdr) BOX_LEN(22)

--------------- test_changed ----------------------

read_j2k:

NAME(test_changed.j2k)
LENG(2948)

ENTER read_jp2c
marker(0xff4f) <== J2K_CODESTREAM_MAGIC part1
    soc len(0)
marker(0xff51) <== J2K_CODESTREAM_MAGIC part2
    siz len(47)
    capabilities(0)
    x(0 : 134) y(0 : 165)
    xt(0 : 134) yt(0 : 165)
    nr_components(3)
      component[0]signed(0) prec(8) hsep(1) vsep(1)
      component[1]signed(0) prec(8) hsep(1) vsep(1)
      component[2]signed(0) prec(8) hsep(1) vsep(1)
---------------------------------------------------

winfried

Reported by szukw000 on 2011-08-02 20:23:02

@gcode-importer
Copy link
Author

test_original.j2k is not a valid JPEG 2000 file. What should openjpeg support it ? Closing
issue.

Reported by malaterre on 2012-01-11 09:42:25

  • Status changed: Done

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

No branches or pull requests

2 participants