Browse Source

export the "gifVersion" when compiled with gif support

v1.x
Nathan Rajlich 13 years ago
parent
commit
7cf35c8396
  1. 8
      lib/canvas.js
  2. 1
      src/Image.cc
  3. 4
      src/Image.h
  4. 3
      src/init.cc

8
lib/canvas.js

@ -45,6 +45,14 @@ if (canvas.jpegVersion) {
exports.jpegVersion = canvas.jpegVersion;
}
/**
* gif_lib version.
*/
if (canvas.gifVersion) {
exports.gifVersion = canvas.gifVersion.replace(/[^.\d]/g, '');
}
/**
* Expose constructors.
*/

1
src/Image.cc

@ -13,7 +13,6 @@
#include <node_buffer.h>
#ifdef HAVE_GIF
#include <gif_lib.h>
typedef struct {
uint8_t *buf;
unsigned len;

4
src/Image.h

@ -15,6 +15,10 @@
#include <jerror.h>
#endif
#ifdef HAVE_GIF
#include <gif_lib.h>
#endif
class Image: public node::ObjectWrap {
public:
char *filename;

3
src/init.cc

@ -30,6 +30,9 @@ init (Handle<Object> target) {
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
#ifdef HAVE_GIF
target->Set(String::New("gifVersion"), String::New(GIF_LIB_VERSION));
#endif
}
NODE_MODULE(canvas,init);

Loading…
Cancel
Save