This returns the description of a numerical error code in English. This is also the documentation of all the error codes. */
| 5924 | the documentation of all the error codes. |
| 5925 | */ |
| 5926 | const char* lodepng_error_text(unsigned code) |
| 5927 | { |
| 5928 | switch(code) |
| 5929 | { |
| 5930 | case 0: return "no error, everything went ok"; |
| 5931 | case 1: return "nothing done yet"; /*the Encoder/Decoder has done nothing yet, error checking makes no sense yet*/ |
| 5932 | case 10: return "end of input memory reached without huffman end code"; /*while huffman decoding*/ |
| 5933 | case 11: return "error in code tree made it jump outside of huffman tree"; /*while huffman decoding*/ |
| 5934 | case 13: return "problem while processing dynamic deflate block"; |
| 5935 | case 14: return "problem while processing dynamic deflate block"; |
| 5936 | case 15: return "problem while processing dynamic deflate block"; |
| 5937 | case 16: return "unexisting code while processing dynamic deflate block"; |
| 5938 | case 17: return "end of out buffer memory reached while inflating"; |
| 5939 | case 18: return "invalid distance code while inflating"; |
| 5940 | case 19: return "end of out buffer memory reached while inflating"; |
| 5941 | case 20: return "invalid deflate block BTYPE encountered while decoding"; |
| 5942 | case 21: return "NLEN is not ones complement of LEN in a deflate block"; |
| 5943 | /*end of out buffer memory reached while inflating: |
| 5944 | This can happen if the inflated deflate data is longer than the amount of bytes required to fill up |
| 5945 | all the pixels of the image, given the color depth and image dimensions. Something that doesn't |
| 5946 | happen in a normal, well encoded, PNG image.*/ |
| 5947 | case 22: return "end of out buffer memory reached while inflating"; |
| 5948 | case 23: return "end of in buffer memory reached while inflating"; |
| 5949 | case 24: return "invalid FCHECK in zlib header"; |
| 5950 | case 25: return "invalid compression method in zlib header"; |
| 5951 | case 26: return "FDICT encountered in zlib header while it's not used for PNG"; |
| 5952 | case 27: return "PNG file is smaller than a PNG header"; |
| 5953 | /*Checks the magic file header, the first 8 bytes of the PNG file*/ |
| 5954 | case 28: return "incorrect PNG signature, it's no PNG or corrupted"; |
| 5955 | case 29: return "first chunk is not the header chunk"; |
| 5956 | case 30: return "chunk length too large, chunk broken off at end of file"; |
| 5957 | case 31: return "illegal PNG color type or bpp"; |
| 5958 | case 32: return "illegal PNG compression method"; |
| 5959 | case 33: return "illegal PNG filter method"; |
| 5960 | case 34: return "illegal PNG interlace method"; |
| 5961 | case 35: return "chunk length of a chunk is too large or the chunk too small"; |
| 5962 | case 36: return "illegal PNG filter type encountered"; |
| 5963 | case 37: return "illegal bit depth for this color type given"; |
| 5964 | case 38: return "the palette is too big"; /*more than 256 colors*/ |
| 5965 | case 39: return "more palette alpha values given in tRNS chunk than there are colors in the palette"; |
| 5966 | case 40: return "tRNS chunk has wrong size for greyscale image"; |
| 5967 | case 41: return "tRNS chunk has wrong size for RGB image"; |
| 5968 | case 42: return "tRNS chunk appeared while it was not allowed for this color type"; |
| 5969 | case 43: return "bKGD chunk has wrong size for palette image"; |
| 5970 | case 44: return "bKGD chunk has wrong size for greyscale image"; |
| 5971 | case 45: return "bKGD chunk has wrong size for RGB image"; |
| 5972 | /*Is the palette too small?*/ |
| 5973 | case 46: return "a value in indexed image is larger than the palette size (bitdepth = 8)"; |
| 5974 | /*Is the palette too small?*/ |
| 5975 | case 47: return "a value in indexed image is larger than the palette size (bitdepth < 8)"; |
| 5976 | /*the input data is empty, maybe a PNG file doesn't exist or is in the wrong path*/ |
| 5977 | case 48: return "empty input or file doesn't exist"; |
| 5978 | case 49: return "jumped past memory while generating dynamic huffman tree"; |
| 5979 | case 50: return "jumped past memory while generating dynamic huffman tree"; |
| 5980 | case 51: return "jumped past memory while inflating huffman block"; |
| 5981 | case 52: return "jumped past memory while inflating"; |
| 5982 | case 53: return "size of zlib data too small"; |
| 5983 | case 54: return "repeat symbol in tree while there was no value symbol yet"; |
no outgoing calls
no test coverage detected