Skip to content

Commit

Permalink
Added scopes.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoopa committed Sep 1, 2013
1 parent 1219a15 commit 0bc1aaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion src/JPEGStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 0bc1aaf

Please sign in to comment.