Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

export the "gifVersion" when compiled with gif support

  • Loading branch information...
commit 7cf35c83961137da5c3be2c56f4d981616a3becc 1 parent ba234ea
@TooTallNate TooTallNate authored
Showing with 15 additions and 1 deletion.
  1. +8 −0 lib/canvas.js
  2. +0 −1  src/Image.cc
  3. +4 −0 src/Image.h
  4. +3 −0  src/init.cc
View
8 lib/canvas.js
@@ -46,6 +46,14 @@ if (canvas.jpegVersion) {
}
/**
+ * gif_lib version.
+ */
+
+if (canvas.gifVersion) {
+ exports.gifVersion = canvas.gifVersion.replace(/[^.\d]/g, '');
+}
+
+/**
* Expose constructors.
*/
View
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;
View
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;
View
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);
Please sign in to comment.
Something went wrong with that request. Please try again.