diff --git a/imageInput.c b/imageInput.c index da49d25..e17d387 100644 --- a/imageInput.c +++ b/imageInput.c @@ -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; } diff --git a/testFile.info2 b/testFile.info2 index 86c028a..1ea3b4c 100644 Binary files a/testFile.info2 and b/testFile.info2 differ