Menu

#302 png_set_rows can't take const-pointers

libpng_code
open
nobody
None
5
2024-10-24
2024-10-24
Jan Wilmans
No

When writing a png to disk, the row_pointers are only ever read from, but the API requires them to be non-const.

Perhaps we could add row_pointers 'png_set_rows_const'. That was no existing users break, but we can at have new uses const correct.

I would around it using the code below at the client side, but of course this is not great.

void png_set_rows_const(png_const_structrp png_ptr, png_inforp info_ptr, const png_byte ** row_pointers)
{
png_set_rows(png_ptr, info_ptr, const_cast<png_bytepp>(row_pointers));
}</png_bytepp>

Discussion


Log in to post a comment.

MongoDB Logo MongoDB