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

images get weirdly stretched when switching pages #159

Open
Owyn opened this issue Nov 11, 2021 · 3 comments
Open

images get weirdly stretched when switching pages #159

Owyn opened this issue Nov 11, 2021 · 3 comments

Comments

@Owyn
Copy link

Owyn commented Nov 11, 2021

example url: https://exhentai.org/g/2057968/d411c07474/

video: https://user-images.githubusercontent.com/1309656/141286760-f661df51-36d4-4e96-bfd8-fbf1c481e952.mp4

settings:
image

Browser:
image

Script manager: TamperMonkey stable v4.13.6136

@Owyn
Copy link
Author

Owyn commented Nov 16, 2021

also, before turning the page - current page is being scrolled all the way up to the top for no reason

@SoraHjort
Copy link

In terms of the first issue. What is going on is the archive has different sized and shaped images. The way the webcomic reader works is that it caches the image source data and then alters it's only comic tag with the src location when you navigate to and fro.

Meaning it has to recalculate the image size every time you switch a page. For most archives this isn't a problem as they have a more unified size. But with image sets and the like such as in your example, they can vary extremely, thus, the stretching issue occurs.

Can this be combatted? Maybe, but would likely require a bit of rewriting.

As for the second comment/issue, this is due to wcr's order of operations. It'll switch the image before auto scrolling up. In an ideal world this would occur at the same time. However the only "solution" I can think of that wouldn't require major work would to simply change the order to change the image first then scroll up.

But for those who use this script to read comics that may not be ideal since that would spoil the last panels before the scroll up.

This issue though tends to occur more noticeably on high resolution images or quite low end machines, due to the time it takes to do these change overs. The only other idea to cover it up would the image fade into the next page after scrolling up. This would require less of a rewrite, and more inserting stuff in the right place. It would be less visually jarring to have it scroll up then fade, than for it to scroll up and then pop to the next image. This would require some testing however.

I am currently working on updating my fork that I use to submit pulls to this project, if I remember after some of the more major stuff, I'll try to remember to test it. It would likely also require adding some settings in graphics to turn on/off as well as timing. But this might be a ways off.

@Owyn
Copy link
Author

Owyn commented Dec 23, 2021

recalculate the image size every time you switch a page
that would spoil the last panels before the scroll up.

Sounds like a desync-d timing issue tho

I was hoping attaching some events and doing stuff in the right time would fix it? (e.g. scrolling to top and changing img resolution only when the new image starts loading (gets its naturalWidth & height set already)
Just so it would do things seemingly instantly without much waiting time like it is now

Maybe the desync is related to "force loading next page" not working? #157
cuz it's supposed to show next image being loaded in real time with it and it currently doesn't

But anyway, thank you for your work.

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

No branches or pull requests

2 participants