diff options
Diffstat (limited to 'src/helper')
| -rw-r--r-- | src/helper/pixbuf-ops.cpp | 7 | ||||
| -rw-r--r-- | src/helper/png-write.cpp | 14 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/helper/pixbuf-ops.cpp b/src/helper/pixbuf-ops.cpp index cd4f539ec..d44b2207b 100644 --- a/src/helper/pixbuf-ops.cpp +++ b/src/helper/pixbuf-ops.cpp @@ -75,8 +75,7 @@ bool sp_export_jpg_file(SPDocument *doc, gchar const *filename, gchar c[32]; g_snprintf(c, 32, "%f", quality); gboolean saved = gdk_pixbuf_save(pixbuf->getPixbufRaw(), filename, "jpeg", NULL, "quality", c, NULL); - g_free(c); - + return saved; } @@ -140,10 +139,10 @@ Inkscape::Pixbuf *sp_generate_internal_bitmap(SPDocument *doc, gchar const */*fi cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height); if (cairo_surface_status(surface) == CAIRO_STATUS_SUCCESS) { - Inkscape::DrawingContext ct(surface, Geom::Point(0,0)); + Inkscape::DrawingContext dc(surface, Geom::Point(0,0)); // render items - drawing.render(ct, final_bbox, Inkscape::DrawingItem::RENDER_BYPASS_CACHE); + drawing.render(dc, final_bbox, Inkscape::DrawingItem::RENDER_BYPASS_CACHE); inkpb = new Inkscape::Pixbuf(surface); } diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp index b8b815b4c..a7ebe7423 100644 --- a/src/helper/png-write.cpp +++ b/src/helper/png-write.cpp @@ -142,7 +142,7 @@ sp_png_write_rgba_striped(SPDocument *doc, Inkscape::IO::dump_fopen_call(filename, "M"); fp = Inkscape::IO::fopen_utf8name(filename, "wb"); - g_return_val_if_fail(fp != NULL, false); + if(fp == NULL) return false; /* Create and initialize the png_struct with the desired error handler * functions. If you want to use the default stderr and longjump method, @@ -335,14 +335,14 @@ sp_export_get_rows(guchar const **rows, void **to_free, int row, int num_rows, v cairo_surface_t *s = cairo_image_surface_create_for_data( px, CAIRO_FORMAT_ARGB32, ebp->width, num_rows, stride); - Inkscape::DrawingContext ct(s, bbox.min()); - ct.setSource(ebp->background); - ct.setOperator(CAIRO_OPERATOR_SOURCE); - ct.paint(); - ct.setOperator(CAIRO_OPERATOR_OVER); + Inkscape::DrawingContext dc(s, bbox.min()); + dc.setSource(ebp->background); + dc.setOperator(CAIRO_OPERATOR_SOURCE); + dc.paint(); + dc.setOperator(CAIRO_OPERATOR_OVER); /* Render */ - ebp->drawing->render(ct, bbox); + ebp->drawing->render(dc, bbox); cairo_surface_destroy(s); *to_free = px; |
