You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I use ok_png_read_to_buffer() or ok_jpg_read_to_buffer() to decode image and storage raw data in a buffer , I can't get the data in there, and error_message is empty.
I find something wrong in your code, maybe I use it wrong.
In the ok_png.c line 750, you check the dst_buffer and create it. But if the dst_buffer is preallocated, you do nothing. So I add a else case like this else{png->data = decoder->dst_buffer;}, then it's correct.
It's the same case in the ok_jpg.c line 1586.
Excuse me for bad english!
The text was updated successfully, but these errors were encountered:
That is intentional. png->data is not set in that case, so that ok_png_free doesn't deallocate data. The decoded data will be in the buffer your code provides.
when I use
ok_png_read_to_buffer()
orok_jpg_read_to_buffer()
to decode image and storage raw data in a buffer , I can't get the data in there, anderror_message
is empty.I find something wrong in your code, maybe I use it wrong.
In the
ok_png.c
line 750, you check thedst_buffer
and create it. But if the dst_buffer is preallocated, you do nothing. So I add aelse
case like thiselse{png->data = decoder->dst_buffer;}
, then it's correct.It's the same case in the
ok_jpg.c
line 1586.Excuse me for bad english!
The text was updated successfully, but these errors were encountered: