libcimbar icon indicating copy to clipboard operation
libcimbar copied to clipboard

Fail to encode file in web app

Open freejool opened this issue 11 months ago • 6 comments

It's ok to encode a 2MB file, but when uploading a 30MB file --> Image

freejool avatar Jan 27 '25 09:01 freejool

Unfortunately we need a block of contiguous memory, and sometimes the OS/browser doesn't want to do that (sometimes?) when the size is large enough.

Not sure what a good solution is (it'll become more important if/when I'm able to increase the transfer speed)

sz3 avatar Jan 28 '25 04:01 sz3

Figuring out how much is the usual max size and how to increase that restriction may be helpful.

freejool avatar Jan 28 '25 04:01 freejool

#96, #132 also describe this same problem.

I do think we can do better with memory usage during encoding. I'm not sure how many of these errors it'll solve, but I'm looking into it. (basically: the encoder C api needs to accept the input file in multiple chunks -- we'll still store the compressed file in contiguous memory, but that might be enough to get things under control)

sz3 avatar Aug 15 '25 00:08 sz3

So with https://github.com/sz3/libcimbar/releases/tag/v0.6.3, this might actually work now. 🤔

sz3 avatar Oct 17 '25 05:10 sz3

sorry for the delay ;)

In my case(Safari 26.0.1), the file size limit is still approximately 20MB. Tested with https://github.com/sz3/libcimbar/releases/download/v0.6.3/cimbar_js.html and https://cimbar.org/

Image

freejool avatar Nov 04 '25 01:11 freejool

Thanks for testing this!

We might be looking at a browser-dependent soft upper limit. 🤔

(basically: we should add some better error handling to at least explain the error, but I'm not sure what else we can do about this for now)

sz3 avatar Nov 04 '25 18:11 sz3