libpng: write a bigger png than 1002px
I'm currently wri开发者_如何学Goting a c++ program which should write me a png file as output. So I made a little code, actually works. I just took the source code from here and condesed it. My code is nopasted here.
BUT: It only works if it doesn't exceed 1002 pixels in width. I am very sure the problem is somewhere around lines 29/30, so a malloc problem, but I don't get it.
Thanks for your help & greez
Without diving into the code too deeply, there are these interesting constants:
unsigned width = 1003;
unsigned height = 500;
int rowbytes = 4000;
The last one directly controls the amount of memory allocated. Have you tried increasing this value?
精彩评论