anka-213 / webcomic_reader

Webcomic Reader userscript at
https://openuserjs.org/scripts/anka-213/Webcomic_Reader
MIT License
120 stars 27 forks source link

Option to fit a page subsection to screen #88

Open Darayavaush opened 6 years ago

Darayavaush commented 6 years ago

Some manga, like this or this have huge white borders on top and bottom, so I think it would be nice to have the following: add to settings a checkbox "fit page subsection to screen"; when it is checked, on the main screen next to the 'Start slideshow' and 'Settings' button two fields appear, where an offset from top and from bottom is specified.

Thus, so example, if I put there 50 and 100 with fit-to-screen enanbled, then the script will scroll so that the top of the screen lines up with a line 50px down from the top of the image and then scale the image down until the bottom of the screen aligns with a line 100px up from the bottom of the image.

anka-213 commented 6 years ago

You can already do (something similar to) this by using a negative border with fit-to-screen. This will remove as many pixels as you specify on the top and bottom of the image. negative border

anka-213 commented 6 years ago

Does this solve your problem?

Darayavaush commented 6 years ago

Ooh, thanks! I gave it a test and at first glance it's almost exactly what I was looking for - I'd like an option to specify asymmetric top and bottom borders (maybe specify the two numbers in one field, separated by a semicolon?). Also, it would be nice to have a note that this cropping is what negative numbers in this field do.