Mercurial > geeqie.yaz
comparison src/thumb.c @ 855:0c3f6ef17d18
Tidy up.
author | zas_ |
---|---|
date | Wed, 25 Jun 2008 20:53:52 +0000 |
parents | 06929cbcd796 |
children | f40509d56fe3 |
comparison
equal
deleted
inserted
replaced
854:a0cdc9d066ae | 855:0c3f6ef17d18 |
---|---|
590 gchar buffer[XV_BUFFER]; | 590 gchar buffer[XV_BUFFER]; |
591 guchar *data; | 591 guchar *data; |
592 gint width, height, depth; | 592 gint width, height, depth; |
593 | 593 |
594 file = fopen(filename, "rt"); | 594 file = fopen(filename, "rt"); |
595 if(!file) return NULL; | 595 if (!file) return NULL; |
596 | 596 |
597 fgets(buffer, XV_BUFFER, file); | 597 fgets(buffer, XV_BUFFER, file); |
598 if(strncmp(buffer, "P7 332", 6) != 0) | 598 if (strncmp(buffer, "P7 332", 6) != 0) |
599 { | 599 { |
600 fclose(file); | 600 fclose(file); |
601 return NULL; | 601 return NULL; |
602 } | 602 } |
603 | 603 |
604 while (fgets(buffer, XV_BUFFER, file) && buffer[0] == '#') /* do_nothing() */; | 604 while (fgets(buffer, XV_BUFFER, file) && buffer[0] == '#') /* do_nothing() */; |
605 | 605 |
606 if(sscanf(buffer, "%d %d %d", &width, &height, &depth) != 3) | 606 if (sscanf(buffer, "%d %d %d", &width, &height, &depth) != 3) |
607 { | 607 { |
608 fclose(file); | 608 fclose(file); |
609 return NULL; | 609 return NULL; |
610 } | 610 } |
611 | 611 |
663 g_free(path); | 663 g_free(path); |
664 | 664 |
665 packed_data = load_xv_thumbnail(thumb_name, &width, &height); | 665 packed_data = load_xv_thumbnail(thumb_name, &width, &height); |
666 g_free(thumb_name); | 666 g_free(thumb_name); |
667 | 667 |
668 if(packed_data) | 668 if (packed_data) |
669 { | 669 { |
670 guchar *rgb_data; | 670 guchar *rgb_data; |
671 GdkPixbuf *pixbuf; | 671 GdkPixbuf *pixbuf; |
672 gint i; | 672 gint i; |
673 | 673 |