int check_extension(char *str)
{
int i;

for (i = 0; str[i] && str[i + 4]; ++i);
if (strncmp(str + i, ".pnm", 4);
return (1);
return (0);
}