Hébergement
    
    
    
    
    Forum
    
 
            
#include <stdio.h>
int main (int argc, char *argv[])
{
char buf[7];
FILE *in, *out;
unsigned char w=0,h=0,w1=0,h1=0;
        if ( argc < 2 ) { printf("gif_info <filename>\n"); exit(0);}
        if((in = fopen(argv[1],"rb"))== NULL){
                printf("impossible a ouvrir: \n",argv[1]);
                exit(0);
        }
        fread(buf,1,6,in); buf[6] = 0x00;
        fread(&w,1,1,in);
        fread(&w1,1,1,in);
        fread(&h,1,1,in);
        fread(&h1,1,1,in);
        if ( ! strncmp(buf,"GIF89a",6) || ! strncmp(buf,"GIF87a",6))
           printf("%s %s width=\"%d\" height=\"%d\"\n",argv[1],
              buf,w+256*w1,h+256*h1);
        else
          printf("%s : Erreur de format %s\n", argv[1], buf);
        fclose(in);
}
| Youhp3 | Youpee est un preprocesseur HTML pour vous simplifier toutes les tâches répétitives dans la création d'un site web. Salemioche.net utilise trés largement ses possibilités | 
| cygwin | le compilateur gcc sous windows ainsi que tous les outils unix (awk, grep, sed, bash, ksh ...) |