-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't generate zip file of images #151
Comments
I don't see any obvious issue... Could you check the type of |
If |
So we have a If it works for you too, do you have an example page to reproduce your issue ? |
Yes it works. |
I reproduced your error in scriptish, I'll investigate to find out why JSZip doesn't work in this environment. |
All right! I'll wait |
This seems to come from The following test case logs var encoder = new TextEncoder("utf-8");
var testU8 = encoder.encode("test");
var isU8 = testU8 instanceof Uint8Array;
console.log("testU8=", testU8);
console.log("isU8=", isU8); |
So.. I'm quite confused.. Is JSZip to blame or Scriptish? |
I don't know yet if this comes from Scriptish or from Firefox itself (but it's not JSZip). I'll dig a bit more and report the issue. I don't see any workaround without modifying JSZip source code. If you're ok with a custom file (until a fix for this issue) you can comment these lines in utf8.js and object.js. |
I reported the bug to Mozilla here. I'll also fix it in JSZip (you can blame JSZip for using an API flagged as experimental :p) |
Good! |
I did some testing with the fixed version of JSZip.
Is there something we could do? |
Something's not right: in the Could it be that some files are JPEG pictures and thus they are rendered incorrectly (“either white or black”) when they are given |
You could also use an ajax request (with |
@Mithgol Yeah, this is a mistake. It should be
|
@Kwbmm almost :) |
The goal was to provide a faster utf8 encoding / decoding. This API is only available on Firefox and it doesn't work well in a Firefox addon context (the generated Uint8Array and the available Uint8Array class come from different contexts, leading to bugs and performance issues). Instead of adding more conditions to (try to) detect if the Uint8Array is from the same context or not, I think it's better to remove this optimization for now. Fix Stuk#151.
For information, for those interrested in arraybuffer for jquery ajax, I have developed a plugin here : https://github.com/acigna/jquery-ajax-native |
I'm developing a script that fetches a series of images ( that can be either png or jpg ), encodes them in base64 and zip them.
Everything seems to work as expected except for the generate function that throws an error:
TypeError: transform[inputType] is undefined
After some digging I saw that at some point the function
exports.transformTo
receives as input and empty Uint8Array that when passed toexports.getTypeOf
fromvar inputType = exports.getTypeOf(input);
doesn't return anything ( for reasons I can't get ).This is the code in JSZip that creates issues:
While this one is part of the code I wrote:
Would love some help!
The text was updated successfully, but these errors were encountered: