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

gdal_translate core dumped when using TILEPARTS=RESOLUTIONS with JP2OpenJPEG driver #7713

Closed
IdanAviv89 opened this issue May 8, 2023 · 2 comments · Fixed by #7717
Closed
Assignees

Comments

@IdanAviv89
Copy link
Contributor

IdanAviv89 commented May 8, 2023

Hi,
I am trying to convert the following raster to Jpeg2000 with tile parts separated by resolution.
I saw in the driver option that this is possible using the TILEPARTS=RESOLUTIONS.
So I used to following command:
gdal_translate -of JP2OpenJPEG la.tif output.j2k -co CODEC=J2K -co TILEPARTS=RESOLUTIONS

And received the following error:
image

I am using gdal 3.6.4 and openjpeg 2.5.0.

Thanks in advance,
Idan

rouault added a commit to rouault/gdal that referenced this issue May 8, 2023
rouault added a commit to rouault/gdal that referenced this issue May 8, 2023
@rouault rouault self-assigned this May 8, 2023
@rouault
Copy link
Member

rouault commented May 8, 2023

Fix for segfault in GDAL in #7717

But there is a underlying openjpeg error.

The issue can be reproduced with only opj_compress with:

$ gdal_translate la.tif tmp.tif
$ opj_compress -I -t 1024,1024 -n 4 -TP R -i tmp.tif -o output.j2k -c  "[512,512],[256,512],[256,512],[128,512],[64,512],[32,512],[16,512],[8,512],[4,512],[2,512]"

TIFFReadDirectory: Warning, Unknown field with tag 33550 (0x830e) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 33922 (0x8482) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 34735 (0x87af) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 34737 (0x87b1) encountered.
[INFO] tile number 1 / 16
[ERROR] opj_t2_encode_packet(): accessing precno=1 >= 1
[ERROR] Cannot encode tile
failed to encode image: opj_encode
failed to encode image: opj_end_compress
failed to encode image

@IdanAviv89
Copy link
Contributor Author

Hi,
Thanks for the help.
I wasn’t sure if the problem was in Gdal or in OpenJpeg (the -TP option is not documented in openjpeg).
I will try to look into openjpeg and see if I can find what cause this problem.

rouault added a commit that referenced this issue May 9, 2023
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 a pull request may close this issue.

2 participants