Giter Site home page Giter Site logo

Comments (8)

phillipberndt avatar phillipberndt commented on May 28, 2024

I'm having some trouble reproducing this, though I have an idea what might be the issue.

  • Please build pqiv with an additional debug line. In function image_file_updated_callback, before the line if(bostree_node_count(file_tree) > 1), add a line printf("Removed file %s\n", FILE(node)->display_name);. Does pqiv notice that the file that ought not to be displayed is actually gone?
  • Are you able to create a minimal example? A set of image URLs, a pqiv call and order/timing for the removal of the files would be ideal.

from pqiv.

TommyFlowers avatar TommyFlowers commented on May 28, 2024

I'm struggling to reproduce in a simple fashion, I will keep trying. However the following instructions will cause pqiv to core dump around 25% of the time and I'm hoping it is related.

  1. Put the below script in a file and run
  2. The slideshow should start. 1 picture of Einstein and 2 of Darwin
  3. When a picture of Darwin is displayed, hit "s" to pause
  4. The script will delete the Darwins, leaving Einstein.
  5. Around 25% of the time pqiv will then core.

Many thanks for looking into it and I'll continue to try and repro the 1st issue in a simple way.

mkdir ~/pqiv-test
mkdir ~/pqiv-test2
cd ~/pqiv-test
wget http://www3.nd.edu/~networks/HumanDynamics_20Oct05/images/Einstein_1_JPEG.jpg
wget http://www3.nd.edu/~networks/HumanDynamics_20Oct05/images/Darwin_3_jpg.jpg
wget http://www3.nd.edu/~networks/HumanDynamics_20Oct05/images/Darwin_1_jpg.jpg

pqiv -s -f -F -d 10.0 --watch-directories --shuffle ~/pqiv-test &
echo "Pause slideshow when a Darwin picture is displayed"

sleep 20
echo "Deleting photos now"
cp ~/pqiv-test/Darwin_.jpg ~/pqiv-test2
rm ~/pqiv-test/Darwin_.jpg

from pqiv.

TommyFlowers avatar TommyFlowers commented on May 28, 2024

Last 2 lines of script should have an asterisk after "Darwin".
Github has removed asterisks!

from pqiv.

phillipberndt avatar phillipberndt commented on May 28, 2024

Thanks! Please test if the latest commit fixes the segfault for you. (And possibly the other issue as well.)

from pqiv.

TommyFlowers avatar TommyFlowers commented on May 28, 2024

Tested and confirmed it fixes segfault. Also, no repeat of the other issue. Many thanks!

from pqiv.

TommyFlowers avatar TommyFlowers commented on May 28, 2024

I've got a short use case that can reproduce the original problem. I'm using commit point 7a36426.

The following will start a slideshow on 1 image. We then delete the image and then add in a new one. The result is a slideshow of the 2 images.

Thanks!

mkdir ~/pqiv-test
mkdir ~/pqiv-test2
cd ~/pqiv-test2
wget http://www3.nd.edu/~networks/HumanDynamics_20Oct05/images/Einstein_1_JPEG.jpg
wget http://www3.nd.edu/~networks/HumanDynamics_20Oct05/images/Darwin_1_jpg.jpg
cd ..
cp pqiv-test2/Einstein_1_JPEG.jpg pqiv-test
pqiv -s -f -F -d 10.0 --watch-directories --shuffle ~/pqiv-test &

sleep 20
echo "Deleting photo now"
rm ~/pqiv-test/Einstein_1_JPEG.jpg

sleep 20
echo "Adding photo now"
cp pqiv-test2/Darwin_1_jpg.jpg pqiv-test

echo "Slideshow of 2 photos!"
ls -al ~/pqiv-test

from pqiv.

phillipberndt avatar phillipberndt commented on May 28, 2024

I see. Thanks, that clarifies a lot. Here's what happened:

If an image that is currently loaded (ie. one of the previous, current and next image) is removed, pqiv decides what to do based on how many images are available: If there is more than one image, it tries to reload the file, triggering the file-not-found mechanism and thus unloading it. If the image was the last one, it skips this entirely to prevent pqiv from exiting due to all images having become unavailable. Since it caches the adjacent images, adding one new image to the directory won't unload the loaded, but deleted, image, and hence it continues to show up in the slideshow. Only once you've added at least 3 new images, pqiv will unload it (Let's call the old image no. 1, and follow with 2, 3, 4. If you view image 3, 2 and 4 are adjacent, and 1 will be unloaded) and try to reload it next time it is to be shown - and then it would finally remove that image from the list.

To fix this, I now mark removed images to be reloaded upon the next attempt to display them. You should still see [2/2] in the info box while Darwin is displayed, but the next attempt to switch to the Einstein picture will fail and leave you with only Darwin.

from pqiv.

TommyFlowers avatar TommyFlowers commented on May 28, 2024

Thanks for the explanation and the lightening fast fix. It does the trick. Cheers!

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.