fitscore icon indicating copy to clipboard operation
fitscore copied to clipboard

Header validation error

Open Saturnyn opened this issue 2 years ago • 1 comments

Hi, I'm using the library to validate an existing fits file, but I get an error message that I don't understand: "Data contains 9 bytes but supposed to be 24385536 bytes"

I don't understand the validation code that triggers this error. In AnyHDU.swift: if modified == false && headerUnit.count < headerUnit.dataSize {

It looks like it is comparing two different things, the number of items in the header and the number of bytes in the data ?

Have I missed something ?

Saturnyn avatar Jul 20 '23 08:07 Saturnyn

Hi,

I haven't given this code a look for a long time, but I think you might be right. That line seems to compare apples with oranges. I remember that I was always unhappy with the verification code and created a branch to fix this (https://github.com/brampf/fitscore/tree/verify). But I believe I abandoned that branch, but cannot remember what was the reason.

brampf avatar Jul 20 '23 17:07 brampf