-
Notifications
You must be signed in to change notification settings - Fork 466
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
Bigendian: opj_compress + opj_decompress fails #518
Comments
Let me know you will need access to a big endian machine (ppc64) |
On Wed, 24 Jun 2015 16:44:50 -0700, Sandro Mani wrote:
A long time ago I sent a patch for PPC64 to [email protected] Here it is again. Ignore it once more. Or apply it. winfried --- openjpeg-2.x-trunk-r3006-1/src/lib/openjp2/cio.c.orig 2015-05-31 23:37:08.000000000 +0000 void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes)
assert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32));
void opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes) *p_value = 0;
void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes) |
Thanks, that patch works. I suppose the best chance of getting it committed is by creating a pull request. Do you want to do so or shall I? |
manisandro, please do it yourself. Good luck. winfried |
manisandro, here is a supplement for #518. The file 'data//input/conformance/file6.jp2' does not have 16-Bit but 12-Bit. I have found --- openjpeg/src/bin/jp2/convert.c.orig 2015-06-11 03:03:10.000000000 +0000
I suppose there should be another change for 'imagetotif()' in case the infile is Please excuse that I insert the change here. I do not know how to send a fix for winfried |
Something has gone wrong here:--- openjpeg/src/bin/jp2/convert.c.orig 2015-06-11 03:03:10.000000000 +0000
winfried |
In case you are interested in how to work with github:
Hope this helps. |
No, this did not help. I meant your 'Fix opj_write_bytes_BE' patch. winfried |
manisandro, I have now found a GRAY TIFF image with 16-Bit. What follows is the complete patch. winfried--- openjpeg/src/bin/jp2/convert.c.orig 2015-06-11 03:03:10.000000000 +0200
@@ -1775,7 +1775,9 @@ if(b > 65535) b = 65535; else if(b < 0) b = 0;+#ifdef OPJ_BIG_ENDIAN
+fprintf(stderr,"%s:%d:\n\ttiftoimage numcomps(%d)\n",FILE,LINE,numcomps);
|
This is a mess. I give up. winfried |
@masandro, here is another attempt. winfried --- openjpeg/src/bin/jp2/convert.c.orig 2015-06-11 03:03:10.000000000 +0200
@@ -1775,7 +1775,9 @@ if(b > 65535) b = 65535; else if(b < 0) b = 0;+#ifdef OPJ_BIG_ENDIAN
+fprintf(stderr,"%s:%d:\n\ttiftoimage numcomps(%d)\n",FILE,LINE,numcomps);
|
Just to clarify, I'm not involved in openjpeg development, so I'm not really in the position to review these patches. I'd encourage you to file pull requests, it really is pretty simple. |
@szukw000 PR is indeed the preferred way to submit patches (pasting them here does not work as comments here support mardown language). There is a learning curve indeed but it's really worthwile. Thanks. |
@szukw000, @manisandro, could you test the master branch following #535 merge ? It should correct the big endianness issue for TIFF conversion. |
Related to PR #521 |
@mayeut, testing your changes in master-openjpeg-2015-07-18 I have made a small change for tiftoimage(). BUT: you have forgotten to apply the patch in #518. The difference can bee seen in http://home.arcor.de/szukw000/cio.txt.zip winfried --- converttif.c.orig 2015-07-18 02:11:45.902539565 +0000
|
On bigendian, converting some image to j2k and decompressing it again results in failure, i.e.:
A quick scan through the codebase reveals for instance in
convert.c
portions of code such aswhich likely produce wrong results on bigendian.
The text was updated successfully, but these errors were encountered: