Skip to content
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

Solution for issue 78 #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Solution for issue 78 #81

wants to merge 2 commits into from

Conversation

TBthegr81
Copy link

Issue #78 had problems with the comic site rendering 2 pages at once, always. And when downloading they only got two-page spreads.
This cuts up any image thats wider than its high, and outputs 2 pages each half-width instead.

…ves. For use when comic-reader forces 2-page view only
@sgbeal
Copy link

sgbeal commented Feb 21, 2019

This will break many two-page spreads in non-manga books. See Fables number 150 for an example which contains many two-page spreads, some of which cannot be read properly if they are split down the middle.

@sgbeal
Copy link

sgbeal commented Feb 21, 2019

Here's an example of a page which would break horribly if split down the middle:
page112

@TBthegr81
Copy link
Author

So what could be a solution to only apply this where its needed?
One thing would be to add it to the extension-option page, default off but could be turned on for people who have problems like myself or original issue-creator.

I don't own any western comics on the service to compare with the manga, so I am not sure if one could programmatically detect if splitting the page would be a bad idea or not.

@sgbeal
Copy link

sgbeal commented Feb 21, 2019

Conversely, i don't have any Manga, only western comics ;). Personally, i'm against any "artificial programmatic manipulation" of the pages because any heuristic will be wrong some percentage of the time. i wouldn't have anything against this being made an option for those who want it, but i would not like to see the app try to automatically determine whether or not a split is useful (it would never be desirable for the 2500+ books in my library). While i dislike two-page spreads because they're difficult to read on a tablet, i dislike more the idea of having the reader try to split them up for me. There are doubtlessly certain users who prefer the two-page view for manga (which is presumably why comixology uses it). To me the real solution sounds like asking Comixology to add one-page view mode for Manga. They've always been highly responsive to my support requests, and i suspect they would consider such a request.

In any case, that's all just my opinion. i'm not a developer on this project and have no authoritative say-so :).

@TBthegr81
Copy link
Author

TBthegr81 commented Feb 21, 2019

Thing is, the site only forces two-page spreads on desktop browsers, in the (android) app all pages is shown individually.
How does the app handle comics with pages like the example you posted?
And how does it handle 2-page spreads that you need to rotate on it's side?
Are they handled the same of differently?

@sgbeal
Copy link

sgbeal commented Feb 21, 2019

Their Android app shows a whole logical page at a time, whether it's a normal-sized page or a double page (which it still counts as a single page). For double pages it shrinks them to fit the screen unless you're using the read mode which only shows a single panel at a time, in which case it zooms into individual panels (areas of the page defined by the publisher which may or may not match the visual panels (if any) on the page). Panel view requires extra metadata which is not available to this Chrome extension, though.

On a 7-inch tablet dual pages are effectively unusable - i do all of my comics reading on a 10-inch tablet. For two-page spreads is simply rotate the tablet and zoom in (if needed). If a book has more than 2 or 3 of them, that gets really annoying, so i stop reading and wait until i get around to reading it on my computer. i truly hate dual pages, any any comic book artist who uses them probably has never tried to use them on a tablet.

@TBthegr81
Copy link
Author

Now see, that's interesting. Because that means they have encoded information about each page if they are supposed to be viewed as a two-page spread.
That might be information that could be read and the decision could be made if a page should be cut or not.
What happens on a desktop is that they assume ya want to fill your screen and that desktop-computer screens are always wider than they are tall and that's the problem with the scraping.

Say, if you read a comic with normal pages on a desktop computer, do you have the option to only show one at a time? The button is grayed out for me on all series I own, but maybe it's different with comicbooks.

@sgbeal
Copy link

sgbeal commented Feb 21, 2019

The Android app apparently simply looks at the size of the page graphic and fits it to the screen. It doesn't need to know if it's a dual page or not because in its world "page" means "a single graphic".

Yes, if you read a comic using their online reader you have the option of viewing only a page at a time, but the definition of "page" is not the same as a physical page: two-page spreads are viewed as a single logical page, and thus this extension downloads them as a single page (it has no other option). This extension would be useless to me if the only option was two-page mode :/.

i don't know what Comixology's metadata for for each page looks like but i have seen DarkHorse's and assume they are semantically equivalent. DarkHorse's metadata looks like... (just randomly picking one from my backups...)

  "pages": [
...
        {
      "is_preview": false, 
      "skip": false, 
      "height": 2048, 
      "sort_order": 2, 
      "id": 203716, 
      "title": null, 
      "width": 1332, 
      "book_id": 2905, 
      "viewports": [
        {
          "width": 1331, 
          "pos_x": 0, 
          "pos_y": 3, 
          "sort_order": 1, 
          "ext_url": "", 
          "page_id": 203716, 
          "id": 915679, 
          "height": 2041
        }, 
        {
          "width": 411, 
          "pos_x": 276, 
          "pos_y": 457, 
          "sort_order": 2, 
          "ext_url": "", 
          "page_id": 203716, 
          "id": 915680, 
          "height": 969
        }, 
        {
          "width": 615, 
          "pos_x": 683, 
          "pos_y": 391, 
          "sort_order": 3, 
          "ext_url": "", 
          "page_id": 203716, 
          "id": 915682, 
          "height": 677
        }, 
        {
          "width": 589, 
          "pos_x": 680, 
          "pos_y": 1121, 
          "sort_order": 4, 
          "ext_url": "", 
          "page_id": 203716, 
          "id": 915683, 
          "height": 617
        }
      ], 
      "src_image": "516fbbc0-2b88-5a24-a53d-333d9719c175", 
      "mime_type": "image/jpeg"
    }, 
... repeats that structure for each page

The viewports part defines the x/y/width/height of each panel - most pages have more than 1 viewports entry, but some pages, e.g. the cover, do not.

@TBthegr81
Copy link
Author

Well that could still work for comics then.
The script should be able to extract if the comicviewer is being run in single-page mode. In those cases it would never split pages, regardless of their aspect-ratio.

If it detects its being run in dual-page mode it could enable the check and splitting of pages.
Sure, this messes stuff up for people scraping comics in dual-page mode, especially if their intent is to download everything as two-page spreads, regardless if they need to be that way or not.
But in that case the function would still be opt-in from the options-page.

@sgbeal
Copy link

sgbeal commented Feb 21, 2019

That... sounds reasonable to me, but i have no idea if there are any special considerations for two-page mode. @Cortys will be able to answer that.

@hwharrison
Copy link

It would definitely be better if the extension could differentiate between merged single pages and real two page spreads, but this is already a really useful feature for people with vertical monitors or windows tablets (also, some people might want all the pages to be single anyway). I second making it a default-off manual setting for now. I took the liberty of adding @TBthegr81 's solution to the options menu (default off): #82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants