Giter Site home page Giter Site logo

Comments (11)

phillipberndt avatar phillipberndt commented on May 28, 2024

Have a look at the feature-disable-wrap branch. It's not exactly what you want, but should be close: It adds an option --disable-wrap-around to make pqiv stop in slideshow mode once the last image has been reached. If --watch-directories is set and a new image is found, pqiv then continues the slideshow. (It does not work with --shuffle yet, but it should not be a problem to extend the feature such that pqiv begins to wait once all images have been seen once.)

Would this suffice, or do you need pqiv to exit once every image has been seen?

from pqiv.

TommyFlowers avatar TommyFlowers commented on May 28, 2024

It's very close but not quite!

I have a use case to show images randomly but then display any new images that have arrived in a certain time period. I do this by starting a second, temporary, pqiv instance on just the new arrived images. The first instance uses --shuffle and --watch-directories. Ideally the second instance would run through its slideshow and exit, leaving the first instance to pick up the new images as normal.

from pqiv.

phillipberndt avatar phillipberndt commented on May 28, 2024

Normal shuffle mode remembers which pictures were already viewed and selects the next image randomly from all images that have not. Only once all images have been viewed, the list is emptied and a new cycle begins. New images count as not already viewed. i.e. if you start up pqiv with --shuffle and --watch-directories, you can be certain that new images are displayed before the cycle repeats.

Does this chance anything? If it does not, I'll add something like --once.

from pqiv.

TommyFlowers avatar TommyFlowers commented on May 28, 2024

Thanks for the info. I ran a test to try a achieve the above behaviour. It looks close but not quite.

I start with 6 images in a folder and start pqiv with:

pqiv -s -f -F -d 5.0 --watch-directories --shuffle ~/photos

The info box shows images loading in the following order:

4/6
5/6
3/6
6/6
1/6
5/6 <- image 2 seems to have been forgotten?
3/6
4/6
1/6
4/6
2/6 <- First time image 2 is displayed
5/6
3/6

I then copy 2 new images into the ~/photos folder. The sequence continues as follows:

3/8
1/8
2/8
8/8 <- First new image displayed
3/8
4/8
7/8 <- Second new image

Some observations:

  1. pqiv picks up the new images - info box starts showing image x/8. This is good.
  2. However, it doesn't display the first new image until a few old ones have gone by. Ideally (for my use case at least) once pqiv spots new images it starts displaying only those
  3. After the 1st new image is displayed a few old images are displayed before the final new one is shown. Could this be the same as the issue above where image 2 was forgotten?

Thanks again for your help.

from pqiv.

phillipberndt avatar phillipberndt commented on May 28, 2024

This is indeed a bug, thanks for spotting it! I'll fix it asap.

However, it doesn't display the first new image until a few old ones have gone by. Ideally (for my
use case at least) once pqiv spots new images it starts displaying only those

Then a bugfix won't resolve this issue for you, since the next image after adding new ones will be selected from all images that have not been viewed yet in the current cycle, plus the new ones, and not only from the new ones. I don't think that this requirement is sufficiently common to add it to the shuffle mode. → I'll simply add --once, but probably name it --end-of-slideshow-action=quit or similar.

from pqiv.

TommyFlowers avatar TommyFlowers commented on May 28, 2024

No problem at all!
Potentially an option like "--prefer-new-images" implemented as a separate list containing the new images that pqiv dips into first if this option is supplied would be the absolute ideal!

But certainly, the new option will be completely fine for our case for now - so many thanks again.

from pqiv.

phillipberndt avatar phillipberndt commented on May 28, 2024

For the first half of this, see 5099201.

from pqiv.

phillipberndt avatar phillipberndt commented on May 28, 2024

..and 981d238 in the feature-end-of-slideshow-action branch for the other one. --end-of-files-action=quit should work, please give it a try.

from pqiv.

TommyFlowers avatar TommyFlowers commented on May 28, 2024

Tested 5099201. Works great - thanks.

Will test out the feature branch soon.

from pqiv.

TommyFlowers avatar TommyFlowers commented on May 28, 2024

I've tested the feature branch. Works perfectly. Many thanks for this.

Will you merging to master?

from pqiv.

phillipberndt avatar phillipberndt commented on May 28, 2024

Great. Just did. 😊

from pqiv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.