Comments (4)
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.
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.
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.
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)
- Add a toolbar for things in the menu HOT 1
- Write metadata back to the archive HOT 5
- Close Help screen when clicking outside of it
- Remove EventEmitter and have objects extend EventTarget HOT 1
- Use new Google Identity Services
- Search / Auto-populate comic book metadata HOT 1
- Paginate eBooks HOT 1
- Long-strip and Wide-strip do not handle resizing the window properly
- Look into OCR
- Use Sensor API to automatically detect orientation HOT 3
- Demos on README no longer work
- Read books panel by panel HOT 3
- Handle "Remove" for current book in Reading Stack
- EPUB does not display cover images. HOT 1
- Cannot load second EPUB
- Support links inside epub HOT 1
- Missing elements support in EPUB allowlist
- EPUB files throw errors with stylesheets referenced in the <head>
- EPUB should support bookmarks
- EPUB should have another progress stage of "Inflating the DOM"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kthoom.