J
jcasique.torres
Hi everyboy.
I trying to create a C promang in an AIX System to read JPG files but
when it read just the first 4 bytes when it found a DLE character (^P)
doesn't read anymore. I using fread function. Here a few lines:
char *sAnv;
....
sprintf(file_a, "%s/anverso.jpg", strDir);
if ((fImagen = fopen(file_a,"rb")) == NULL)
{
printf("ERROR: No se pudo abrir el archivo |%s|\n", file_a);
continue;
}
fseek(fImagen, 0, SEEK_END);
lLongitud = ftell(fImagen);
rewind(fImagen);
sAnv = (char *) malloc(sizeof(char) * lLongitud);
if (!sAnv)
{
printf("Problema de memoria. Imagen anverso. Tamaño: (%d)\n",
lLongitud);
fin(-1);
}
fread(sAnv, 1, lLongitud, fImagen);
fclose(fImagen);
.....
free(sAnv);
Does anybody help with this problem.
P.D. Sorry about my english but it doesn't my native
language.
I trying to create a C promang in an AIX System to read JPG files but
when it read just the first 4 bytes when it found a DLE character (^P)
doesn't read anymore. I using fread function. Here a few lines:
char *sAnv;
....
sprintf(file_a, "%s/anverso.jpg", strDir);
if ((fImagen = fopen(file_a,"rb")) == NULL)
{
printf("ERROR: No se pudo abrir el archivo |%s|\n", file_a);
continue;
}
fseek(fImagen, 0, SEEK_END);
lLongitud = ftell(fImagen);
rewind(fImagen);
sAnv = (char *) malloc(sizeof(char) * lLongitud);
if (!sAnv)
{
printf("Problema de memoria. Imagen anverso. Tamaño: (%d)\n",
lLongitud);
fin(-1);
}
fread(sAnv, 1, lLongitud, fImagen);
fclose(fImagen);
.....
free(sAnv);
Does anybody help with this problem.
P.D. Sorry about my english but it doesn't my native
language.