Discussion:
[cairo] Conditions under which CAIRO_STATUS_WRITE_ERROR occurs?
Andy Meneely
2017-10-20 14:20:05 UTC
Permalink
Hi,
I maintain a Ruby gem that uses Cairo, and one of my users is reporting
an error that results in a CAIRO_STATUS_WRITE_ERROR being returned.
https://github.com/andymeneely/squib/issues/236

I haven't been able to reproduce the conditions myself, and the only times
I have ever gotten that was when I tried to write to a file that was being
held onto by another process. I'm confident that we've eliminated that.

What other conditions might you get a CAIRO_STATUS_WRITE_ERROR on a
cairo_write_to_png
call?

-Andy
Uli Schlachter
2017-10-21 10:47:53 UTC
Permalink
Hi,
Post by Andy Meneely
What other conditions might you get a CAIRO_STATUS_WRITE_ERROR on a
cairo_write_to_png
call?
looking through src/cairo-png.c, I find:

- Trying to write a surface with width or height 0
- When opening the output file fails (fopen())
- When fwrite() to the output file fails, i.e. ferror() returns non-zero
- When closing the output file fails (fclose())

Cheers,
Uli
--
Happiness can't be found -- it finds you.
- Majic
--
cairo mailing list
***@cairographics.org
https://lists.cairographics.org/mailman/listinfo
Loading...