further testing
This commit is contained in:
parent
6b039bf852
commit
6a2a5f7997
17
imageInput.c
17
imageInput.c
@ -24,7 +24,7 @@ GrayScaleImageSeries *readImages(const char *path)
|
|||||||
FILE *readSource;
|
FILE *readSource;
|
||||||
unsigned int numberOfBytesToRead = 0;
|
unsigned int numberOfBytesToRead = 0;
|
||||||
const unsigned int amountOfStatusInfoToRead = 1;
|
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 !!!!!!!!
|
//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;
|
unsigned int bytesToRead = 0;
|
||||||
|
|
||||||
fread(headerString, sizeof(*headerString), amountToRead, source);
|
fread(headerString, sizeof("__info2_image_file_format__\0"), amountToRead, source);
|
||||||
fread(imageCount, sizeof(*imageCount), amountToRead, source);
|
fread(imageCount, 4, 1, source);
|
||||||
fread(imageWidth, sizeof(*imageWidth), amountToRead, source);
|
fread(imageWidth, sizeof(int), amountToRead, source);
|
||||||
fread(imageHeight, sizeof(*imageHeight), amountToRead, source);
|
fread(imageHeight, sizeof(int), amountToRead, source);
|
||||||
|
|
||||||
bytesToRead = (*imageWidth) * (*imageHeight);
|
bytesToRead = (*imageWidth) * (*imageHeight);
|
||||||
// state of debugging:
|
// state of debugging:
|
||||||
@ -100,7 +100,12 @@ unsigned int readStatusInfo(FILE *source, char *const headerString, unsigned int
|
|||||||
// return nonsensical numbers
|
// return nonsensical numbers
|
||||||
// is the sizeof() command correct??
|
// is the sizeof() command correct??
|
||||||
printf("hier\n");
|
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;
|
return bytesToRead;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
testFile.info2
BIN
testFile.info2
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user