Giter Club home page Giter Club logo

Comments (4)

dduponchel avatar dduponchel commented on June 29, 2024

When you generate the zip file, you don't have (yet) the image loaded. Try generating the blobLink.href in the ajax callback, after adding the image file :-)

You also found a bug in JSZip : without any content, the generated file is invalid...

from jszip.

dduponchel avatar dduponchel commented on June 29, 2024

After some tests, I found out that the empty JSZip zip file and an empty zip file generated with zip are exactly the same :

$ hexdump test.zip 
0000000 4b50 0605 0000 0000 0000 0000 0000 0000
0000010 0000 0000 0000                         
0000016

(zip doesn't want to create an empty zip file so I used the zip test.zip deleteme.txt ; zip -d test.zip deleteme.txt trick and I got a nice zip warning: zip file empty)

file doesn't recognize the file type but unzip print a warning : warning [test.zip]: zipfile is empty.
I think the result isn't a bug, just a strange usecase. Maybe we should log a warning when generating an empty zip file ?

from jszip.

Mithgol avatar Mithgol commented on June 29, 2024

You'd better leave it as is, otherwise you'd eventually have to face some fellow who needs empty zip files for some reason and thus needs an option to disable that warning.

from jszip.

benogle avatar benogle commented on June 29, 2024

Well I feel dumb. Obviously it needs to be in the callback.

Thanks for the quick response.

from jszip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.