Compare commits
No commits in common. "6189a5aa1e7b943807f42a165282f6250a794c2c" and "24b843fb77f3f405434249f1fd04ed922bd1d79f" have entirely different histories.
6189a5aa1e
...
24b843fb77
32
imageInput.c
32
imageInput.c
@ -87,33 +87,23 @@ void clearSeries(GrayScaleImageSeries *series)
|
||||
unsigned int readStatusInfo(FILE *source, char *const headerString, unsigned int *const imageCount, unsigned int *const imageWidth, unsigned int *const imageHeight, int const amountToRead)
|
||||
{
|
||||
unsigned int bytesToRead = 0;
|
||||
int numred = 0;
|
||||
int numred2 = 0;
|
||||
int numred3 = 0;
|
||||
int numred4 = 0;
|
||||
|
||||
*imageCount = 0;
|
||||
*imageWidth = 0;
|
||||
*imageHeight = 0;
|
||||
|
||||
numred = fread(headerString, sizeof("__info2_image_file_format__\0"), 1, source);
|
||||
numred2 = fread(imageCount, sizeof(unsigned int), 1, source);
|
||||
numred3 = fread(imageWidth, sizeof(unsigned int), 1, source);
|
||||
numred4 = fread(imageHeight, sizeof(unsigned int), 1, source);
|
||||
|
||||
*imageCount = 2;
|
||||
|
||||
fread(headerString, sizeof("__info2_image_file_format__\0"), amountToRead, source);
|
||||
fread(imageCount, sizeof(int), 1, source);
|
||||
fread(imageWidth, sizeof(int), amountToRead, source);
|
||||
fread(imageHeight, sizeof(int), amountToRead, source);
|
||||
|
||||
bytesToRead = (*imageWidth) * (*imageHeight);
|
||||
|
||||
// state of debugging:
|
||||
// stopped here,
|
||||
// read width and height
|
||||
// return nonsensical numbers
|
||||
// is the sizeof() command correct??
|
||||
printf("hier\n");
|
||||
printf("numred: %d\n", numred);
|
||||
printf("stringsize: %lld\n", sizeof("__info2_image_file_format__"));
|
||||
printf("stringsize: %lld\n", sizeof(headerString));
|
||||
printf("string: %send\n", headerString);
|
||||
printf("numred2: %d\n", numred2);
|
||||
printf("count: %u\n", *imageCount);
|
||||
printf("numred3: %d\n", numred3);
|
||||
printf("width: %u\n", *imageWidth);
|
||||
printf("numred4: %d\n", numred4);
|
||||
printf("height %u\n", *imageHeight);
|
||||
printf("bytes to read = %u\n", bytesToRead);
|
||||
return bytesToRead;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user