Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Make CAIRO_FORMAT_INVALID optional to support outdated versions of Cairo #342

terebentina opened this Issue · 11 comments

6 participants


Any chance you could do with CAIRO_FORMAT_INVALID what you did for CAIRO_FORMAT_RGB30 in this PR: #315 ?
From reading around, it seems it's the same problem.

This is what I get when trying to install canvas 1.1.1 with cairo 1.8.8-3.1.el6:

  CXX(target) Release/
In file included from ../src/
../src/PNG.h: In function ‘cairo_status_t canvas_write_png(cairo_surface_t*, void (*)(png_struct*, png_byte*, png_size_t), void*)’:
../src/PNG.h:161: error: ‘CAIRO_FORMAT_INVALID’ was not declared in this scope
make: *** [Release/] Error 1

/cc @kkoopa


Apparently, Cairo 1.8.8 was released in 2009 and CAIRO_FORMAT_INVALID officially appeared in 2010. The value is supposed to be -1. I don't know if anything will break by messing around with it, but at the same time I don't see if it is worth doing for a 4-year old version of a library that has received several updates since. Why can't you use a version of Cairo from this decade?

Either way, adding


somewhere before png.h:161 should probably work.


The reason is a CentOS 6.3 production server and not being allowed to install packages outside of yum repos.
I'll try your suggestion, thanks.


CentOS ... it's always CentOS causing problems for Node.

-1 to pandering to CentOS.

@rcoup rcoup referenced this issue from a commit in koordinates/node-canvas
@rcoup rcoup Add CAIRO_FORMAT_INVALID c1180d1

any update? how can I make this work?


@ericstob what's your specific use-case for this? CentOS too?


@rvagg mine was Ubuntu Lucid which is still in LTS support for a bit longer :smile:

@ericstob add the patch / use the fork from koordinates@c1180d1 ala npm install git:// ?


Yeah, that patch is simple enough. If everything else works properly then +1 to getting this solved. Someone want to submit a PR to get koordinates@c1180d1 in? I don't see an existing PR for it.


@rvagg see #370 - I didn't bother originally since it seemed like your comments earlier were a #wontfix


@rcoup I'm not maintainer, just a noisy voice! However it does seem like a fairly easy fix to support Ubuntu LTS (I curse at CentOS) if you're experience is that everything else works fine.


I ended up moving to latest fedora so maybe you should keep this bug open :)

@kangax kangax closed this in #370
@vvo vvo referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.