-
Notifications
You must be signed in to change notification settings - Fork 318
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
Export Brew as a CBZ file #3556
base: master
Are you sure you want to change the base?
Conversation
This version of the code works *IF* all CSS URLs are relocated to trusted locations - IE, the local server. After this I will be continuing my work attempting to do URL rewrites for arbitrary purposes in support of this PR and direct PDF creation.
This feature works in two parts. This first part is by adding a prioxy-passthrough for resources. This enables the code to get around XSS issues we were previously having,. The second part clones the first page, massages URLs in it's <Links>, <style>, and <img> tags to use the L to load the resources then generate two thumbnails. One is 115px tall and the other is set at 50% the page height. Currently, only the smaller of the two is stored as a new BrewStub field.
This changes the PDF print option to an Export menu with PDF as the first choice and CBZ as the second. CBZ Export is functional, but not quite perfect. There are a few border effects that do not seem to work correctly with the image export. As the export progresses the left margin will vanish while it processes to account for the the canvas convertor interpretting the margin. As a plus this functions as a progress meter. :)
I'm not sure any user would notice, but i like the idea of exporting to other file formats. We likely want to mark this as Also, if we are exporting to .CBZ, might as well export as .ZIP if users want too, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I don't personally have a use-case for this feature, I am not specifically against it's inclusion.
At this point, I have only investigated the tests failures; I would suggest it should probably have it's own test suite prior to final merging.
Given a CBZ is just a zip file of images, it's just an extension. |
A |
A set of JPGs/PNGs. So far as I have been able to discern, there is no true format for CBR/CBZ files. It simply walks through the archive in alphabetical order. If there are folders, they are walked as well. |
Well, let's cite wikipedia on this one:
So it is a compressed file of images of every page, to make a comic book. |
Yes, a What I was getting at with my question is are there other end-format constructs that we might want to possibly include as export formats? Things like, oh, ebook, or maybe even a SPA of html/image components for static hosting of brews elsewhere. |
I'd be against the website approach, we could export to html, but i would not go pass that. But an |
I'll look at this in another PR in the future. We're off-track. |
This PR exports the Brew as a CBZ archive readable by various "comic" document readers.
The export isn't quite perfect, there appear to be some issues with some borders ( order of operations, maybe? ) within the library being used. Given this is a minor issue with a subsite of divs, I'm pushing this now for evaluation while I look for alternatives and/or fix the library.
To prevent menubar clutter, this PR moves the PDF printing item to a new Export menu and adds the CBZ export below it.