added a header to the file format

-Yosh
This commit is contained in:
Manish Singh 1999-08-27 22:02:18 +00:00
parent 4a9ae94655
commit b3fdade3a4
4 changed files with 40 additions and 3 deletions

View File

@ -1,3 +1,7 @@
Fri Aug 27 15:00:03 PDT 1999 Manish Singh <yosh@gimp.org>
* app/levels.c: added a small header to the file format
Fri Aug 27 10:57:28 PDT 1999 Manish Singh <yosh@gimp.org>
* user_install

View File

@ -1469,6 +1469,12 @@ read_levels_from_file (FILE *f)
int i, fields;
char buf[50], *nptr;
if (!fgets (buf, 50, f))
return FALSE;
if (strcmp (buf, "# GIMP Levels File\n") != 0)
return FALSE;
for (i = 0; i < 5; i++)
{
fields = fscanf (f, "%d %d %d %d ",
@ -1477,7 +1483,10 @@ read_levels_from_file (FILE *f)
&low_output[i],
&high_output[i]);
if (fields != 4 || !fgets(buf, 50, f))
if (fields != 4)
return FALSE;
if (!fgets (buf, 50, f))
return FALSE;
gamma[i] = strtod(buf, &nptr);
@ -1507,6 +1516,8 @@ write_levels_to_file (FILE *f)
{
int i;
fprintf (f, "# GIMP Levels File\n");
for (i = 0; i < 5; i++)
{
fprintf (f, "%d %d %d %d %f\n",

View File

@ -1469,6 +1469,12 @@ read_levels_from_file (FILE *f)
int i, fields;
char buf[50], *nptr;
if (!fgets (buf, 50, f))
return FALSE;
if (strcmp (buf, "# GIMP Levels File\n") != 0)
return FALSE;
for (i = 0; i < 5; i++)
{
fields = fscanf (f, "%d %d %d %d ",
@ -1477,7 +1483,10 @@ read_levels_from_file (FILE *f)
&low_output[i],
&high_output[i]);
if (fields != 4 || !fgets(buf, 50, f))
if (fields != 4)
return FALSE;
if (!fgets (buf, 50, f))
return FALSE;
gamma[i] = strtod(buf, &nptr);
@ -1507,6 +1516,8 @@ write_levels_to_file (FILE *f)
{
int i;
fprintf (f, "# GIMP Levels File\n");
for (i = 0; i < 5; i++)
{
fprintf (f, "%d %d %d %d %f\n",

View File

@ -1469,6 +1469,12 @@ read_levels_from_file (FILE *f)
int i, fields;
char buf[50], *nptr;
if (!fgets (buf, 50, f))
return FALSE;
if (strcmp (buf, "# GIMP Levels File\n") != 0)
return FALSE;
for (i = 0; i < 5; i++)
{
fields = fscanf (f, "%d %d %d %d ",
@ -1477,7 +1483,10 @@ read_levels_from_file (FILE *f)
&low_output[i],
&high_output[i]);
if (fields != 4 || !fgets(buf, 50, f))
if (fields != 4)
return FALSE;
if (!fgets (buf, 50, f))
return FALSE;
gamma[i] = strtod(buf, &nptr);
@ -1507,6 +1516,8 @@ write_levels_to_file (FILE *f)
{
int i;
fprintf (f, "# GIMP Levels File\n");
for (i = 0; i < 5; i++)
{
fprintf (f, "%d %d %d %d %f\n",