Browse Source

export the "jpegVersion" when compiled with jpeg support

v1.x
Nathan Rajlich 13 years ago
parent
commit
ba234eaae1
  1. 8
      lib/canvas.js
  2. 6
      src/init.cc

8
lib/canvas.js

@ -37,6 +37,14 @@ exports.version = '0.12.1';
exports.cairoVersion = cairoVersion; exports.cairoVersion = cairoVersion;
/**
* jpeglib version.
*/
if (canvas.jpegVersion) {
exports.jpegVersion = canvas.jpegVersion;
}
/** /**
* Expose constructors. * Expose constructors.
*/ */

6
src/init.cc

@ -5,6 +5,7 @@
// Copyright (c) 2010 LearnBoost <tj@learnboost.com> // Copyright (c) 2010 LearnBoost <tj@learnboost.com>
// //
#include <stdio.h>
#include "Canvas.h" #include "Canvas.h"
#include "Image.h" #include "Image.h"
#include "ImageData.h" #include "ImageData.h"
@ -24,6 +25,11 @@ init (Handle<Object> target) {
Gradient::Initialize(target); Gradient::Initialize(target);
Pattern::Initialize(target); Pattern::Initialize(target);
target->Set(String::New("cairoVersion"), String::New(cairo_version_string())); target->Set(String::New("cairoVersion"), String::New(cairo_version_string()));
#ifdef HAVE_JPEG
char jpeg_version[10];
snprintf(jpeg_version, 10, "%d%c", JPEG_LIB_VERSION_MAJOR, JPEG_LIB_VERSION_MINOR + 'a' - 1);
target->Set(String::New("jpegVersion"), String::New(jpeg_version));
#endif
} }
NODE_MODULE(canvas,init); NODE_MODULE(canvas,init);

Loading…
Cancel
Save