FEATURED IMAGE: 10 Dec 2019, 14:00 UTC | How to Shape a Spiral Galaxy 11 December 2019, 12:26:49UTC RSS RSS | About | Contact | Site Map
Home » News & Blogs » Reading large JP2 files on Fedora
Bookmark and Share
Exploding Galaxies and other Catastrophysics

Reading large JP2 files on Fedora

2 Feb 2018, 02:41 UTC
Reading large JP2 files on Fedora
(200 words excerpt, click title or image to see full post)

I recently had to analyze some very large (>100 megapixel) JP2 files and ran into the following problem on my Fedora 27 machine: jiv sat16_abi_fd6_l1b_CTfullimage_BA03_2018-030-204905.jp2 maximum number of samples exceeded (117679104 > 67108864) error: cannot decode code stream error: cannot load image data cannot load image Segmentation fault (core dumped) I got the same error "maximum number of samples exceeded" message from octave's imread or using gimp, which lead me to this link pointing to a compiled in limit in libjasper.The solution is to compile a custom version of libjasper with a larger limit. This is straightforward, but how to get it done cleanly in terms of RPMs? 1: sudo dnf -y install rpm-build rpmdevtools 2: rpmdev-setuptree 3: rpm -ivh jasper-2.0.14-1.fc27.src.rpm 4: cd rpmbuild/BUILD 5: tar xzvf ../SOURCES/jasper-2.0.14.tar.gz 6: cp -R jasper-2.0.14 jasper-2.0.14p 7: geany ./jasper-2.0.14p/jasper-2.0.14/builder/src/libjasper/include/jasper/jas_config.h 8: diff -puNr jasper-2.0.14/ jasper-2.0.14p/ > ../SOURCES/jasper-2.0.14-largefile.patch 9: cd ../SPECS 10: geany jasper.spec 11: QA_RPATHS=$(( 0x0001|0x0010 )) rpmbuild -ba jasper.spec 12: ls ../RPMS/x86_64/ For step #7 we're making a single line change to move from a 64 megapixel limit to something closer to what we want, in my case 512 megapixels. Here is the diff generated in step #8: 1: diff -puNr jasper-2.0.14/src/libjasper/include/jasper/jas_config.h.in jasper-2.0.14p/src/libjasper/include/jasper/jas_config.h.in ...

Latest Vodcast

Latest Podcast

Advertise PTTU

NASA Picture of the Day

Astronomy Picture of the Day