Skip to content

Commit

Permalink
Try to fix issues with large images
Browse files Browse the repository at this point in the history
  • Loading branch information
as-com committed Jun 20, 2016
1 parent 7d5070c commit d039ca3
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 81 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,5 @@ bh_unicode_properties.cache
# Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings

test-images/
2 changes: 1 addition & 1 deletion build-js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ emconfigure ./configure --without-simd --without-turbojpeg CFLAGS="-O3"
emmake make
cp .libs/cjpeg ../../cjpeg.bc
cd ../..
emcc -O3 --closure 1 --pre-js src/pre.js -s "EXPORTED_RUNTIME_METHODS=[]" -s ELIMINATE_DUPLICATE_FUNCTIONS=1 --memory-init-file 0 cjpeg.bc -o src/cjpeg.js -L'./deps/mozjpeg/.libs' -ljpeg
emcc -O3 --closure 1 --pre-js src/pre.js -s "EXPORTED_RUNTIME_METHODS=[]" -s ELIMINATE_DUPLICATE_FUNCTIONS=1 -s ALLOW_MEMORY_GROWTH=1 --memory-init-file 0 cjpeg.bc -o src/cjpeg.js -L'./deps/mozjpeg/.libs' -ljpeg
Binary file removed out.jpg
Binary file not shown.
Empty file added out2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
154 changes: 78 additions & 76 deletions src/cjpeg.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ module.exports = function(file, options) {
} catch (e) {
return new Error("No output: " + stderr);
}

FS.unlink("/output.jpg");
FS.unlink("/input");

//console.log(file);
return {
"data": toBuffer(file.buffer),
Expand Down
4 changes: 0 additions & 4 deletions testorig.ppm

This file was deleted.

0 comments on commit d039ca3

Please sign in to comment.