Compare commits
3 Commits
24b843fb77
...
6189a5aa1e
| Author | SHA1 | Date | |
|---|---|---|---|
| 6189a5aa1e | |||
| 26073f77af | |||
| f2b748a9c5 |
30
imageInput.c
30
imageInput.c
@ -87,23 +87,33 @@ 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 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;
|
unsigned int bytesToRead = 0;
|
||||||
|
int numred = 0;
|
||||||
|
int numred2 = 0;
|
||||||
|
int numred3 = 0;
|
||||||
|
int numred4 = 0;
|
||||||
|
|
||||||
fread(headerString, sizeof("__info2_image_file_format__\0"), amountToRead, source);
|
*imageCount = 0;
|
||||||
fread(imageCount, sizeof(int), 1, source);
|
*imageWidth = 0;
|
||||||
fread(imageWidth, sizeof(int), amountToRead, source);
|
*imageHeight = 0;
|
||||||
fread(imageHeight, sizeof(int), amountToRead, source);
|
|
||||||
|
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;
|
||||||
|
|
||||||
bytesToRead = (*imageWidth) * (*imageHeight);
|
bytesToRead = (*imageWidth) * (*imageHeight);
|
||||||
// state of debugging:
|
|
||||||
// stopped here,
|
|
||||||
// read width and height
|
|
||||||
// return nonsensical numbers
|
|
||||||
// is the sizeof() command correct??
|
|
||||||
printf("hier\n");
|
printf("hier\n");
|
||||||
printf("stringsize: %lld\n", sizeof(headerString));
|
printf("numred: %d\n", numred);
|
||||||
|
printf("stringsize: %lld\n", sizeof("__info2_image_file_format__"));
|
||||||
printf("string: %send\n", headerString);
|
printf("string: %send\n", headerString);
|
||||||
|
printf("numred2: %d\n", numred2);
|
||||||
printf("count: %u\n", *imageCount);
|
printf("count: %u\n", *imageCount);
|
||||||
|
printf("numred3: %d\n", numred3);
|
||||||
printf("width: %u\n", *imageWidth);
|
printf("width: %u\n", *imageWidth);
|
||||||
|
printf("numred4: %d\n", numred4);
|
||||||
printf("height %u\n", *imageHeight);
|
printf("height %u\n", *imageHeight);
|
||||||
printf("bytes to read = %u\n", bytesToRead);
|
printf("bytes to read = %u\n", bytesToRead);
|
||||||
return bytesToRead;
|
return bytesToRead;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user