Re: Here's a git patch for operations/external/png-load.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks! A few comments:

On 11/10/2010 02:02 AM, Patrick Horgan wrote:
> +  if(fread (header, 1, 8, infile)!=8)

No magic numbers please, use a define for at least 8

> +      g_warning ("%s is not a valid png file", path);

You should give a more detailed error message than just "is not valid"

> +  if(fread (header, 1, 8, infile)!=8)
> +    {
> +      fclose (infile);
> +      g_warning ("%s is not a valid png file", path);
> +      return -1;
> +    }

Instead of duplicating this code from above, it would be better to put 
it in a helper function

  / Martin


-- 

My GIMP Blog:
http://www.chromecode.com/
"Nightly GIMP, GEGL, babl tarball builds"
_______________________________________________
Gegl-developer mailing list
Gegl-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer


[Index of Archives]     [Yosemite News]     [Yosemite Photos]     [gtk]     [GIMP Users]     [KDE]     [Gimp's Home]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux