minor tuning
This commit is contained in:
parent
05f65ef5c9
commit
bce4464719
@ -437,12 +437,16 @@ switch (commande)
|
||||
break;
|
||||
}
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s: return code is %d\n", __FILE__, foo);
|
||||
puts(""); /* make a nicer display in debug mode */
|
||||
#endif
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: return code is %d\n", __FILE__, foo);
|
||||
Image_print_error(argv[0], foo);
|
||||
}
|
||||
|
||||
foo = Image_TGA_save(argv[3], dst, 0);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: error %d saving '%s'\n", __FILE__, foo, argv[3]);
|
||||
Image_print_error(argv[0], foo);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "../tthimage.h"
|
||||
|
||||
#define TGA_OUTILS_VERSION "0.60"
|
||||
#define TGA_OUTILS_VERSION "0.61"
|
||||
/*
|
||||
* 13 Dec 2001: v0.11 a cause du 'mustopen' pour les palettes.
|
||||
* 11 Fev 2002: v0.12 a cause du '-ansi' (hein Kerdeuzz, on y vient)
|
||||
@ -21,7 +21,7 @@
|
||||
* 27 Jan 2014: V0.52 added : 'parse_rect_param'.
|
||||
*/
|
||||
|
||||
#define TGA_OUTILS_COPYLEFT "(dwtfywl) TontonTh 2018"
|
||||
#define TGA_OUTILS_COPYLEFT "(dwtfywl) TontonTh 2022"
|
||||
#define TGA_WWW_SITE "http://la.buvette.org/devel/libimage/"
|
||||
|
||||
#define PERR(txt) fprintf(stderr, "\t| %s\n", (txt))
|
||||
|
@ -26,7 +26,7 @@
|
||||
#define TIMESTAMP 34
|
||||
#define PRHISTO 35
|
||||
#define TAG7SEG0 40
|
||||
|
||||
#define BIZARRE 41
|
||||
#define ENVIRON 50
|
||||
/*::------------------------------------------------------------------::*/
|
||||
mot_clef commandes[] =
|
||||
@ -47,6 +47,7 @@ mot_clef commandes[] =
|
||||
{ "prhisto", PRHISTO, "s", "filename.tga" },
|
||||
{ "tag7", TAG7SEG0, "si", "fname.tga nnn" },
|
||||
{ "environ", ENVIRON, "", "" },
|
||||
{ "bizarre", BIZARRE, "", "portnawak..." },
|
||||
{ "mk_rgb", MK_RGB, "siiiii", "fname w h r g b" },
|
||||
{ NULL, 0, NULL, NULL }
|
||||
};
|
||||
@ -66,31 +67,28 @@ if (foo)
|
||||
{
|
||||
fprintf(stderr, "something is bad with %s : %d\n", filename, foo);
|
||||
Image_print_error("explanation", foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
foo = 0;
|
||||
switch(flags)
|
||||
{
|
||||
case 0:
|
||||
printf("%8d %8d\n", width, height);
|
||||
break;
|
||||
printf("%8d %8d\n", width, height); break;
|
||||
case 1:
|
||||
printf("%dx%d\n", width, height);
|
||||
break;
|
||||
printf("%dx%d\n", width, height); break;
|
||||
case 2:
|
||||
printf(" -w%d -h%d\n", width, height);
|
||||
break;
|
||||
printf(" -w%d -h%d\n", width, height); break;
|
||||
case 3:
|
||||
printf("width=%d height=%d\n", width, height);
|
||||
break;
|
||||
printf("width=%d height=%d\n", width, height); break;
|
||||
case 4:
|
||||
printf("%d\n", width);
|
||||
break;
|
||||
printf("%d\n", width); break;
|
||||
case 5:
|
||||
printf("%d\n", height);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "bad flag %d in %s\n", flags, __func__);
|
||||
abort();
|
||||
foo = BAD_PARAMETER;
|
||||
break; /* unreached ? */
|
||||
}
|
||||
return foo;
|
||||
@ -104,7 +102,7 @@ int foo;
|
||||
fprintf(stderr, "Show Header '%s' %d\n", filename, flag);
|
||||
#endif
|
||||
|
||||
foo = Image_TGA_show_header(filename, 0);
|
||||
foo = Image_TGA_show_header(filename, flag);
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s got %d\n", __func__, foo);
|
||||
@ -240,13 +238,13 @@ char *noms[] =
|
||||
"FIXED_SEED", ENV_DEFAULT_RGBA
|
||||
};
|
||||
|
||||
for (foo=0; foo<(sizeof(noms)/sizeof(char *)); foo++)
|
||||
for (foo=0; foo<(int)(sizeof(noms)/sizeof(char *)); foo++)
|
||||
{
|
||||
ptr = getenv(noms[foo]);
|
||||
printf("%5d %-25s %s\n", foo, noms[foo], ptr);
|
||||
}
|
||||
|
||||
return FUNC_NOT_FINISH;
|
||||
return OLL_KORRECT; /* ? seriously ? */
|
||||
}
|
||||
/*::------------------------------------------------------------------::*/
|
||||
int tag_7_segments_0(char *fname, int value)
|
||||
@ -271,6 +269,10 @@ foo = Image_7seg_tag0(src, buffer, 0);
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s : tagging %s -> %d\n", __func__, fname, foo);
|
||||
#endif
|
||||
if (foo) {
|
||||
fprintf(stderr, "ERR %d IN %s\n", foo, __func__);
|
||||
abort();
|
||||
}
|
||||
|
||||
foo = Image_TGA_save(fname, src, 0);
|
||||
#if DEBUG_LEVEL > 1
|
||||
@ -280,6 +282,20 @@ fprintf(stderr, "%s : saving %s -> %d\n", __func__, fname, foo);
|
||||
return -1;
|
||||
}
|
||||
/*::------------------------------------------------------------------::*/
|
||||
int bizarre(char *fname, int notused)
|
||||
{
|
||||
|
||||
fprintf(stderr, ">>> %s ( %p %d )\n", __func__, fname, notused);
|
||||
|
||||
if (notused) {
|
||||
fprintf(stderr, "in %s notused must be zero, was %d\n",
|
||||
__func__, notused);
|
||||
return INVALID_PARAM;
|
||||
}
|
||||
|
||||
return OLL_KORRECT;
|
||||
}
|
||||
/*::------------------------------------------------------------------::*/
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
int foo;
|
||||
@ -397,11 +413,12 @@ switch(mode)
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Hu ho %d ?\n", mode);
|
||||
foo = FULL_NUCKED;
|
||||
break;
|
||||
}
|
||||
|
||||
if (foo) {
|
||||
fprintf(stderr, "at end of %s, foo was %d\n", __func__, foo);
|
||||
fprintf(stderr, "*** at end of %s, foo was %d\n", __func__, foo);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user