Changeset 2263 for libpipi/trunk/genethumb
- Timestamp:
- Mar 11, 2008, 3:56:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpipi/trunk/genethumb/genethumb.c
r2258 r2263 28 28 pipi_image_t *src, *dst; 29 29 30 int i, w = 0, h = 0 ;30 int i, w = 0, h = 0, bpp = 24; 31 31 32 32 for(;;) … … 36 36 { 37 37 { "geometry", 1, NULL, 'g' }, 38 { "bpp", 1, NULL, 'b' }, 38 39 }; 39 int c = mygetopt(argc, argv, "g: ", long_options, &option_index);40 int c = mygetopt(argc, argv, "g:b:", long_options, &option_index); 40 41 41 42 if(c == -1) … … 44 45 switch(c) 45 46 { 47 case 'b': 48 bpp = atoi(myoptarg); 49 if(bpp != 32 && bpp != 24 && bpp != 16) 50 { 51 fprintf(stderr, "%s: invalid bpp -- %s\n", argv[0], myoptarg); 52 return EXIT_FAILURE; 53 } 54 break; 46 55 case 'g': 47 56 w = atoi(myoptarg); … … 66 75 src = pipi_load(srcname); 67 76 dst = pipi_resize(src, w, h); 77 if(bpp == 16) 78 pipi_dither_24to16(dst); 68 79 pipi_save(dst, dstname); 69 80 pipi_free(src);
Note: See TracChangeset
for help on using the changeset viewer.