diegorep / pypng

Automatically exported from code.google.com/p/pypng
0 stars 0 forks source link

Intolerant of file format errors. #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Feeding badly formatted PNG files into the Reader class will generally upset it.

Some errors are diagnosed with explicit exceptions, some generate warnings, 
others will cause the 
code to mysteriously fall over internally.

There should be a policy on what sorts of errors we will catch and how, and we 
should adhere to it.

Original issue reported on code.google.com by d...@pobox.com on 17 Mar 2009 at 9:40

GoogleCodeExporter commented 8 years ago
A sensible policy would be:
- to be robust against processing files that are obviously not PNGs;
- to detect all errors that are reasonable to detect whilst in the course of 
ordinary processing;
- to generate warnings for all such detected errors that do not affect PyPNG's 
processing (example, chunks in 
wrong order, but PyPNG doesn't care);
- to generate exceptions for the other detected errors.

In other words, we detect what we can without going out of are way.

Detecting and diagnosing typical errors in PNG files probably is useful, but 
it's out of scope for png.py and 
would be a separate tool.

Original comment by d...@pobox.com on 17 Mar 2009 at 9:44

GoogleCodeExporter commented 8 years ago

Original comment by d...@pobox.com on 17 Mar 2009 at 2:27

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
http://code.google.com/p/imagetestsuite/ is an excellent source of not quite 
valid PNG images.

r160 and r161 implement some better format validation.

Original comment by d...@pobox.com on 20 May 2009 at 10:09

GoogleCodeExporter commented 8 years ago
r163 and r165 to r169 implement better format validation, having use the 
brokensuite images.

Original comment by d...@pobox.com on 20 May 2009 at 3:53