Skip to content

Fix build with SVG support enabled #1206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ addons:
- libjpeg8-dev
- libpango1.0-dev
- libgif-dev
- librsvg2-dev
- g++-4.9
env:
- CXX=g++-4.9
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ canvas.createJPEGStream() // new
on the incorrect types.

### Fixed
* Fix build with SVG support enabled (#1123)
* Prevent segfaults caused by loading invalid fonts (#1105)
* Fix memory leak in font loading
* Port has_lib.sh to javascript (#872)
Expand Down
11 changes: 11 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,17 @@
],
'conditions': [
['OS=="win"', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': [
'<(GTK_Root)/bin/librsvg-2-2.dll',
'<(GTK_Root)/bin/libgdk_pixbuf-2.0-0.dll',
'<(GTK_Root)/bin/libgio-2.0-0.dll',
'<(GTK_Root)/bin/libcroco-0.6-3.dll',
'<(GTK_Root)/bin/libgsf-1-114.dll',
'<(GTK_Root)/bin/libxml2-2.dll'
]
}],
'libraries': [
'-l<(GTK_Root)/lib/librsvg-2-2.lib'
]
Expand Down
2 changes: 1 addition & 1 deletion src/Image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ cairo_surface_t *Image::surface() {
cairo_status_t status = renderSVGToSurface();
if (status != CAIRO_STATUS_SUCCESS) {
g_object_unref(_rsvg);
error(Canvas::Error(status));
Nan::ThrowError(Canvas::Error(status));
return NULL;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class Image: public Nan::ObjectWrap {
cairo_status_t assignDataAsMime(uint8_t *data, int len, const char *mime_type);
#endif
#endif
void error(Local<Value> error);
void loaded();
cairo_status_t load();
Image();
Expand Down