raspidmx icon indicating copy to clipboard operation
raspidmx copied to clipboard

Read PNG Image constantly

Open netzfreak opened this issue 9 years ago • 7 comments

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

netzfreak avatar Nov 29 '15 16:11 netzfreak

isnt what https://github.com/AndrewFromMelbourne/raspidmx/tree/master/spriteview does?

nagualcode avatar Nov 29 '15 18:11 nagualcode

@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.

AndrewFromMelbourne avatar Nov 29 '15 22:11 AndrewFromMelbourne

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

ghost avatar Dec 01 '16 18:12 ghost

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

AndrewFromMelbourne avatar Dec 01 '16 20:12 AndrewFromMelbourne

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

ghost avatar Dec 03 '16 12:12 ghost

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?

TheRealFlyingCoder avatar Aug 27 '20 07:08 TheRealFlyingCoder

@TheRealFlyingCoder : could you solve this somehow?

magdesign avatar May 23 '21 10:05 magdesign