I had coded a wrapper for this C implementation in C++ which I recently turned to again. I realized that the function is either erroneous for its wrapper method or for its direct call inside a public method. Why does only one of these two approaches run?
Code:
If (0 !== png_get_PLTE (png,pnginfo,&pltp,&num_plt))
png_set_PLTE (png,pnginfo,pltp,num_plt);
Or:
this->pngobject.get_PLTE (&pltp,&num_plt);
png_set_PLTE (png,pnginfo,pltp,num_plt);
The first two lines are erroneous for a picture that incorporates these parameters: Height 311, Width 233, Bit Depth 8, Color Type 3, Interlace Type 0, Filter 0, Channels 1, Row Bytes 233; Whereas the API is erroneous by libpng error: Valid palette required for paletted images.
The second approach is erroneous for a picture that incorporates these parameters: Height 600, Width 800, Bit Depth 8, Color Type 6, Interlace Type 0, Filter 0, Channels 4, Row Bytes 3200; Whereas the API is erroneous by libpng error: Invalid palette.
The issue is dumb because of successful calls if the codes read and write the other picture.
So, where is the issue? What is problem at all?
Aucun commentaire:
Enregistrer un commentaire