occivink / mpv-image-viewer

Configuration, scripts and tips for using mpv as an image viewer
The Unlicense
284 stars 23 forks source link

Keep Scroll Position + Cycling image fast problem #14

Open fire838 opened 4 years ago

fire838 commented 4 years ago

Problem 1: When going from one image to a second image the scroll position resets to vertical & horizontal center.

Example: I'm very zoomed into the top of picture 1. I press button to go to next image it resets the scroll to the center. Add a option to lock scroll postion between images.

Problem 2: When cycling through images very fast with scroll wheel, it bugs out and loops images? Example: A folder with 20 images, if i scroll wheel to change image very fast, MPV thinks theirs like 100 images but loops?

occivink commented 3 years ago

The problem 1 shouldn't actually occur unless you specifically configured it to do that. Do you use detect-image.lua, and did you maybe simply copy the default configuration?

Are you sure that problem 2 is caused by one of the scripts? Can you narrow it down to which script/configuration causes this?

fire838 commented 3 years ago

Problem 1: I fixed it, had something to do with detect-image.lua

Problem 2: This occurs even with a fresh MPV and MPV-image-viewer configuration. You can replicate this by replacing:

WHEEL_UP script-message cursor-centric-zoom 0.1 WHEEL_DOWN script-message cursor-centric-zoom -0.1

with

WHEEL_UP repeatable playlist-prev WHEEL_DOWN repeatable playlist-next

Try with a 100 picture folder. Mouse wheel fast

Another thing I encountered is that cursor-centric-zoom is awkward when zooming out and in past the borders. I think it the X and Y axis should lock in place if the picture is really far into the borders. 1 min video showing what I mean: https://streamable.com/5xihiw

occivink commented 3 years ago

That makes sense about the cursor-centric-zoom, thanks for the clear comparison. I need to think how it works technically, but it should be similar to the XXX_move_if_full_view flags that already exists

occivink commented 3 years ago

I've now implemented the cursor-centric-zoom changes, let me know if it matches your expectations. I do think it's more useful that way

fire838 commented 2 years ago

Yes this works good.

For problem 2 it is the auto load script, when holding down default arrow keys forward (-->) on a folder with lots of images it loops images. https://streamable.com/t1lcas This folder only has 59 images but when I hold down forward it adds existing images to the playlist.

occivink commented 2 years ago

That's strange indeed. If you can manage to narrow it down more I can try to fix it. For example, does it happen with autoload.lua alone? Or does it have to be combined with another script from this repository? If so, which?

fire838 commented 2 years ago

It behaves the same even when autoload.lua is the only script in the folder.

occivink commented 2 years ago

Ok, then that sounds worth reporting directly on the mpv issue tracker, since that's where the script comes from.