Giter Club home page Giter Club logo

Comments (4)

codedread avatar codedread commented on August 16, 2024

This made me chuckle because I'm going to write a blog post about it :-)

I originally refactored the code for this very reason because loading over Google Drive was sooo slow. Once I had coded it all up, I discovered that not all comic book archives are stored in the correct page order. In fact, in a significant number of archives that I sampled, the first page in the zip/rar file is not the first page of the comic book. All comic book readers must: a) unzip the entire file, b) sort all pages by their filenames, c) display the first page based on the filename.

Of course this is horrible, but probably no one ever thought about streaming comic book archive files before :-/

So ultimately, the unarchiving code in kthoom progressively unarchives the file, then kthoom does the sorting after the unarchiving is all complete. It saves some small amount of time (because the expensive part of the unarchiving can happen progressively as it downloads), but it is definitely not the win I was hoping for :(

If I could guarantee that the archives have properly stored the bytes in page order, then this is a really easy code change (just remove the sorting inside kthoom).

from kthoom.

adamhathcock avatar adamhathcock commented on August 16, 2024

I'm impressed you have streaming unrar and unzip in Javascript :) I've done the same for C# (http://github.com/adamhathcock/sharpcompress) but I've always needed a cross-platform viewer. I wrote a silverlight one years ago with progressive loading. It was nice opening a large file and see the images pop in.

You're right, you'll have to sort on the fly. If something is out of order, just put it in order as you read in the entries. Don't worry if someone created the archive with files out of order.

from kthoom.

codedread avatar codedread commented on August 16, 2024

I've added some preliminary support for progressive loading in kthoom. If:

  • the comic book archive has a ComicInfo.xml file AND
  • ComicInfo.xml is the first file in the archive AND
  • ComicInfo.xml is stored (not compressed) in the archive AND
  • ComicInfo.xml has the following element:

<ArchiveFileInfo xmlns="http://www.codedread.com/sop" optimizedForStreaming="true" />

Then kthoom will show the pages immediately upon extraction.

"sop" stands for "stream-optimized publication".

from kthoom.

codedread avatar codedread commented on August 16, 2024

Calling this implemented now. It does require the comic book archive file to be re-archived and specify that it is optimized for streaming in its metadata file.

from kthoom.

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.