diff --git a/src/Canvas.cc b/src/Canvas.cc index 9df5cdb..ab86673 100644 --- a/src/Canvas.cc +++ b/src/Canvas.cc @@ -13,7 +13,10 @@ #include #include #include "closure.h" + +#ifdef HAVE_JPEG #include "JPEGStream.h" +#endif Persistent Canvas::constructor; @@ -34,7 +37,9 @@ Canvas::Initialize(Handle target) { Local proto = constructor->PrototypeTemplate(); NODE_SET_PROTOTYPE_METHOD(constructor, "toBuffer", ToBuffer); NODE_SET_PROTOTYPE_METHOD(constructor, "streamPNGSync", StreamPNGSync); +#ifdef HAVE_JPEG NODE_SET_PROTOTYPE_METHOD(constructor, "streamJPEGSync", StreamJPEGSync); +#endif proto->SetAccessor(String::NewSymbol("width"), GetWidth, SetWidth); proto->SetAccessor(String::NewSymbol("height"), GetHeight, SetHeight); target->Set(String::NewSymbol("Canvas"), constructor->GetFunction()); @@ -293,6 +298,8 @@ Canvas::StreamPNGSync(const Arguments &args) { * Stream JPEG data synchronously. */ +#ifdef HAVE_JPEG + Handle Canvas::StreamJPEGSync(const Arguments &args) { HandleScope scope; @@ -317,6 +324,8 @@ Canvas::StreamJPEGSync(const Arguments &args) { return Undefined(); } +#endif + /* * Initialize cairo surface. */