further testing

This commit is contained in:
Jonas Hofmann 2025-11-18 08:59:40 +01:00
parent 6b039bf852
commit 6a2a5f7997
2 changed files with 11 additions and 6 deletions

View File

@ -24,7 +24,7 @@ GrayScaleImageSeries *readImages(const char *path)
FILE *readSource;
unsigned int numberOfBytesToRead = 0;
const unsigned int amountOfStatusInfoToRead = 1;
char headerString[sizeof("__info2_image_file_format__")] = "__info2_image_file_format__";
char headerString[sizeof("__info2_image_file_format__\0")] = "";
//speicher allocaten weil *series auf null zeigt !!!!!!!!
@ -88,10 +88,10 @@ unsigned int readStatusInfo(FILE *source, char *const headerString, unsigned int
{
unsigned int bytesToRead = 0;
fread(headerString, sizeof(*headerString), amountToRead, source);
fread(imageCount, sizeof(*imageCount), amountToRead, source);
fread(imageWidth, sizeof(*imageWidth), amountToRead, source);
fread(imageHeight, sizeof(*imageHeight), amountToRead, source);
fread(headerString, sizeof("__info2_image_file_format__\0"), amountToRead, source);
fread(imageCount, 4, 1, source);
fread(imageWidth, sizeof(int), amountToRead, source);
fread(imageHeight, sizeof(int), amountToRead, source);
bytesToRead = (*imageWidth) * (*imageHeight);
// state of debugging:
@ -100,7 +100,12 @@ unsigned int readStatusInfo(FILE *source, char *const headerString, unsigned int
// return nonsensical numbers
// is the sizeof() command correct??
printf("hier\n");
printf("bytes to read = %u", bytesToRead);
printf("stringsize: %lld\n", sizeof(headerString));
printf("string: %send\n", headerString);
printf("count: %u\n", *imageCount);
printf("width: %u\n", *imageWidth);
printf("height %u\n", *imageHeight);
printf("bytes to read = %u\n", bytesToRead);
return bytesToRead;
}

Binary file not shown.