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

Read PNG Image constantly #3

Open
netzfreak opened this issue Nov 29, 2015 · 7 comments
Open

Read PNG Image constantly #3

netzfreak opened this issue Nov 29, 2015 · 7 comments

Comments

@netzfreak
Copy link

Is it possible to a read PNG file continuously? For example every 2 seconds or check file size is different, but without pngview will be closed and restart, without a short black screen.
As loop:
killall -S9 pngview; ./pngview alien.png &
Example so we can make png animation or read time and view it after convert in png.

Thanks,
Patrick

@nagualcode
Copy link

@AndrewFromMelbourne
Copy link
Owner

@netzfreak It certainly would be possible to do, but it isn't something that I have time to do at the moment.

@fredericofs The spriteview program displays different parts of a single PNG image. It only reads the image once. These are known as sprite sheets.

@ghost
Copy link

ghost commented Dec 1, 2016

I also have this problem. Is there a way to open a second image over the first one, and then close the first one?

@AndrewFromMelbourne
Copy link
Owner

No, unfortunately there is no way to do that currently @joachimvenaa.

@ghost
Copy link

ghost commented Dec 3, 2016

Found a solution that works with me
I'm now running this inside a while True loop:

os.system(PNGVIEWPATH + "/pngview -b 0 -l 300003 -x 650 -y 5 icons/battery25.png &")
i = 0
killid = 0
out = check_output("ps aux | grep pngview | awk '{ print $2 }'", shell=True)
nums = out.split('\n')
for num in nums:
    i += 1
    if i == 1:
        os.system("sudo kill " + killid)

This first displays the new png, then kills the old one

@TheRealFlyingCoder
Copy link

So I definitely love opening up a 4 year old issue 👍

A very specific use case resulted in this being the perfect tool for me! But I too need an updating image layer.

I've got a while loop that can re-run code anytime the image file has been updated... but without any comments or instructions i'm struggling to figure out how to update that image layer so that it propagates

image

Are any of the imagelayer.c helper functions suitable for this? Or would I have to destroy and recreate the image layer each time?

@magdesign
Copy link

@TheRealFlyingCoder : could you solve this somehow?

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

5 participants