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

Support FITS images with GZIP_1 compression #7894

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Mar 23, 2024

Helps #7771. The issue requests support for RICE_1 compression. This is a stepping stone, providing support for something other than uncompressed data.

https://fits.gsfc.nasa.gov/fits_primer.html is a helpful source for the specification. It explains that FITS images are comprised of header and data units. After the primary SIMPLE header, an image XTENSION may follow. Each header unit "is a multiple of 2880 bytes long".

https://heasarc.gsfc.nasa.gov/fitsio/c/c_user/node41.html states that "GZIP_1 compresses the array of image pixel value normally with the GZIP algorithm". After decompressing the data, I found that it was padded to 4 bytes and flipped vertically.

The test files are sample images from https://fits.gsfc.nasa.gov/registry/tilecompression.html

@hugovk hugovk merged commit 6464d5c into python-pillow:main Mar 28, 2024
57 checks passed
@radarhere radarhere deleted the fits_gzip branch March 28, 2024 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants