generated from freudenreichan/info2Praktikum-NeuronalesNetz
header prüfen angefangen
This commit is contained in:
parent
39563aec23
commit
1ba120628e
@ -26,7 +26,8 @@ static void readPictureData(FILE *file, unsigned short *ptrPicturesCount, unsign
|
|||||||
GrayScaleImageSeries *readImages(const char *path)
|
GrayScaleImageSeries *readImages(const char *path)
|
||||||
{
|
{
|
||||||
unsigned short picturesCount, pictureWidth, pictureHeight;
|
unsigned short picturesCount, pictureWidth, pictureHeight;
|
||||||
GrayScaleImageSeries *series = malloc(sizeof(GrayScaleImageSeries));;
|
GrayScaleImageSeries *series = malloc(sizeof(GrayScaleImageSeries));
|
||||||
|
char line[26];
|
||||||
|
|
||||||
FILE *file = fopen(path,"rb");
|
FILE *file = fopen(path,"rb");
|
||||||
|
|
||||||
@ -36,6 +37,10 @@ GrayScaleImageSeries *readImages(const char *path)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fread(line, sizeof(line), 1, file);
|
||||||
|
if(strncmp(line, FILE_HEADER_STRING, strlen(FILE_HEADER_STRING))!=0)return NULL;
|
||||||
|
|
||||||
|
fseek(file, 0, SEEK_SET);
|
||||||
|
|
||||||
|
|
||||||
readPictureData(file, &picturesCount, &pictureWidth, &pictureHeight);
|
readPictureData(file, &picturesCount, &pictureWidth, &pictureHeight);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user