簡體   English   中英

為什么不能在瀏覽器中解碼太重的bpg圖像?

[英]Why can't I decode a too heavy bpg image in my browser?

使用Fabrice Bellard 在這里提供的bpg編碼器,在Debian 8 鏈接上按照以下說明進行操作,我已經進行了一些壓縮測試,並使用提供的.js在瀏覽器(firefox chrome)上顯示了結果(或者您可以使用此網站 ) 。

當我想顯示其重量大於(大約)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.

有誰知道這個錯誤來自哪里?

README文件中的第7節給出了問題的根源:

僅8位的解碼器速度更快,並且占用的內存更少(默認情況下為16 MB而不是32 MB,如果要處理較大的圖像,則可以在Makefile中更改內存配置)。

=>默認情況下,太大的圖像會以JavaScript文件無法顯示的方式進行編碼!

錯誤代碼(參見上文)中說明了如何解決該問題:您必須在Makefile中編輯相應的行,然后重新編譯項目。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM