gpt4 book ai didi

javascript - 为什么我无法在浏览器中解码太重的 bpg 图像?

转载 作者:太空宇宙 更新时间:2023-11-04 16:14:44 24 4
gpt4 key购买 nike

使用 Fabrice Bellard 提供的 bpg 编码器 here ,以下说明在我的 Debian 8 link 上,我已经完成了一些压缩测试,并使用提供的 .js 在我的浏览器(firefox chrome)上显示了结果(或者您可以使用 this website )。

当我想要显示重量超过(大约)800 KB(原始宽度:2.6 MB,大小 3600x2700)的 bpg 图像时,控制台中出现以下错误消息:

> 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.

有谁知道这个错误从何而来?

最佳答案

自述文件中的第 7 节给出了问题的根源:

The 8 bit only decoders are a little faster and consumes less memory (16 MB instead of 32 MB by default, you can change the memory configuration in the Makefile if you want to handle larger images).

=> 默认情况下,过大的图像会以 JavaScript 文件无法显示的方式进行编码!

错误代码中解释了如何解决该问题(见上文):您必须编辑 Makefile 中的相应行,然后重新编译项目。

关于javascript - 为什么我无法在浏览器中解码太重的 bpg 图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41165638/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com