使用Fabrice here提供的bpg编码器,在我的debian8 link上按照以下说明,我已经做了一些压缩测试,并使用提供的.js (或者你可以使用this website)在我的浏览器(火狐chrome)上显示结果。
当我想要显示超过(大约)800KB的bpg图片(原始轮距:2.6MB,大小为3600x2700)时,在控制台中会出现以下错误信息:
> Successfully compiled asm.js code (loaded from cache in 21ms)
> pre-main prep time: 0 ms
> Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 33554432, (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.
> uncaught exception: abort() at wa@https://webencoder.libbpg.org/js/bpgdec8.js:19:34
> B@https://webencoder.libbpg.org/js/bpgdec8.js:85:320
> z.b@https://webencoder.libbpg.org/js/bpgdec8.js:11:48
> Z@https://webencoder.libbpg.org/js/bpgdec8.js:53:333
> Vd@https://webencoder.libbpg.org/js/bpgdec8.js:70:1
> fd@https://webencoder.libbpg.org/js/bpgdec8.js:70:1
> sd@https://webencoder.libbpg.org/js/bpgdec8.js:70:1
> Mc@https://webencoder.libbpg.org/js/bpgdec8.js:70:1
> Sc@https://webencoder.libbpg.org/js/bpgdec8.js:70:1
> Tc@https://webencoder.libbpg.org/js/bpgdec8.js:70:1
> _b@https://webencoder.libbpg.org/js/bpgdec8.js:66:1 Kb@https://webencoder.libbpg.org/js/bpgdec8.js:66:1
> Pc@https://webencoder.libbpg.org/js/bpgdec8.js:70:1
> Pd@https://webencoder.libbpg.org/js/bpgdec8.js:70:1
> Kd@https://webencoder.libbpg.org/js/bpgdec8.js:70:1
> @https://webencoder.libbpg.org/js/bpgdec8.js line 15 > eval:1:84
> window.BPGDecoder.prototype.load/d.onload@https://webencoder.libbpg.org/js/bpgdec8.js:88:216 If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.
> Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 33554432, (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.有人知道这个错误是从哪里来的吗?
发布于 2016-12-17 23:01:38
自述文件中的第7节给出了问题的根源:
仅8位解码器速度更快,占用的内存更少(默认情况下是16MB,而不是32MB,如果您想处理更大的图像,可以在Makefile中更改内存配置)。
默认情况下,=>太大了,图像的编码方式不能被JavaScript文件显示!
错误代码(见上)解释了如何修复这个问题:您必须在Makefile中编辑适当的行,然后重新编译项目。
https://stackoverflow.com/questions/41165638
复制相似问题