qiqian / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

libwebp and OpenCV: Segmentation fault #157

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I don't want use jpeg decoder as example, so I replace it by OpenCV, but my 
program have error "Segmentation fault". Someone help me?

Original issue reported on code.google.com by tuansp...@gmail.com on 20 Jun 2013 at 10:03

Attachments:

GoogleCodeExporter commented 8 years ago
My guess:

you need to declare 'uint8_t* output' and pass &output to WebPEncodeRGB(). And 
don't forget to free(output)
later, too!

Like this:

uint8_t* output = NULL;
...
WebPEncodeRGB((uint8_t*)data, width, height, step, qualityFactor,&output);
... // do something with 'output' compressed bytes.
free(output);

Original comment by pascal.m...@gmail.com on 20 Jun 2013 at 10:45

GoogleCodeExporter commented 8 years ago
Excellent!
My program can run but output image size is smaller than when encode by 
command, and output image can not decode to original. I think problem is 
"stride" parameter. Do you think like me?

Original comment by tuansp...@gmail.com on 22 Jun 2013 at 2:40