Permalink
Browse files

Added scopes.

  • Loading branch information...
1 parent 1219a15 commit 0bc1aaf38b78396c1a6cbd45d5167716ea0cea39 @kkoopa kkoopa committed Sep 1, 2013
Showing with 5 additions and 3 deletions.
  1. +2 −2 src/Image.cc
  2. +3 −1 src/JPEGStream.h
View
@@ -572,9 +572,9 @@ Image::loadGIFFromBuffer(uint8_t *buf, unsigned len) {
dst_data++;
src_data++;
}
- }
+ }
}
- } else {
+ } else {
// Image is interlaced so that it streams nice over 14.4k and 28.8k modems :)
// We first load in 1/8 of the image, followed by another 1/8, followed by
// 1/4 and finally the remaining 1/2.
View
@@ -30,6 +30,7 @@ init_closure_destination(j_compress_ptr cinfo){
boolean
empty_closure_output_buffer(j_compress_ptr cinfo){
+ NanScope();
closure_destination_mgr *dest = (closure_destination_mgr *) cinfo->dest;
Local<Object> buf = NanNewBufferHandle((char *)dest->buffer, dest->bufsize);
Local<Value> argv[3] = {
@@ -45,6 +46,7 @@ empty_closure_output_buffer(j_compress_ptr cinfo){
void
term_closure_destination(j_compress_ptr cinfo){
+ NanScope();
closure_destination_mgr *dest = (closure_destination_mgr *) cinfo->dest;
/* emit remaining data */
size_t remaining = dest->bufsize - cinfo->dest->free_in_buffer;
@@ -146,8 +148,8 @@ write_to_jpeg_stream(cairo_surface_t *surface, int bufsize, int quality, bool pr
sl++;
}
free(dst);
- jpeg_free_custom_allocations(&cinfo);
jpeg_finish_compress(&cinfo);
+ jpeg_free_custom_allocations(&cinfo);
jpeg_destroy_compress(&cinfo);
}

0 comments on commit 0bc1aaf

Please sign in to comment.