User avatar
paddyg
Posts: 2422
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Image viewer with transition between images

Sat Sep 07, 2019 9:13 pm

Here's a copy of the PictureFrame.py app using exif rotation.

Code: Select all

#!/usr/bin/python
from __future__ import absolute_import, division, print_function, unicode_literals
''' Simplified slideshow system using ImageSprite and without threading for background
loading of images (so may show delay for v large images).
    Also has a minimal use of PointText and TextBlock system with reduced  codepoints
and reduced grid_size to give better resolution for large characters.
    Also shows a simple use of MQTT to control the slideshow parameters remotely
see http://pi3d.github.io/html/FAQ.html and https://www.thedigitalpictureframe.com/control-your-digital-picture-frame-with-home-assistents-wifi-presence-detection-and-mqtt/
and https://www.cloudmqtt.com/plans.html

USING exif info to rotate images

    ESC to quit, 's' to reverse, any other key to move on one.
'''
import os
import time
import random
import demo
import pi3d

from PIL import Image, ExifTags # these are needed for getting exif data from images

#####################################################
# these variables are constants
#####################################################
#PIC_DIR = '/home/pi/pi3d_demos/textures' #'textures'
PIC_DIR = '/home/patrick/python/pi3d_demos/textures/temp' #'textures'
FPS = 20
FIT = True
EDGE_ALPHA = 0.0 # see background colour at edge. 1.0 would show reflection of image
BACKGROUND = (0.2, 0.2, 0.2, 1.0)
RESHUFFLE_NUM = 5 # times through before reshuffling
FONT_FILE = '/home/patrick/python/pi3d_demos/fonts/NotoSans-Regular.ttf'
CODEPOINTS = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ., _-/' # limit to 49 ie 7x7 grid_size
USE_MQTT = True
#####################################################
# these variables can be altered using mqtt messaging
#####################################################
time_delay = 10.0 # between slides
fade_time = 3.0
shuffle = True # shuffle on reloading
date_from = None
date_to = None
quit = False
paused = False # NB must be set to True after the first iteration of the show!

delta_alpha = 1.0 / (FPS * fade_time) # delta alpha

#####################################################
# some functions to tidy subsequent code
#####################################################
def tex_load(fname, orientation):
  try:
    im = Image.open(fname)
    if orientation > 4: # this is a rotated image)
      im = im.transpose(Image.ROTATE_270)
    if orientation in [2, 4, 5, 8]:
      im = im.transpose(Image.FLIP_LEFT_RIGHT)
    if orientation in [4, 8]:
      im = im.transpose(Image.FLIP_TOP_BOTTOM)
    tex = pi3d.Texture(im, blend=True, m_repeat=True)
  except Exception as e:
    print('''Couldn't load file {}
            (probably related to Apple and or Adobe making assumptions about hardware!!): {}'''.format(fname, e))
    tex = None
  return tex

def tidy_name(path_name):
    name = os.path.basename(path_name).upper()
    name = ''.join([c for c in name if c in CODEPOINTS])
    return name

def get_files(dt_from=None, dt_to=None):
  # dt_from and dt_to are either None or tuples (2016,12,25)
  if dt_from is not None:
    dt_from = time.mktime(dt_from + (0, 0, 0, 0, 0, 0))
  if dt_to is not None:
    dt_to = time.mktime(dt_to + (0, 0, 0, 0, 0, 0))
  global shuffle, PIC_DIR, EXIF_DATID
  file_list = []
  extensions = ['.png','.jpg','.jpeg'] # can add to these
  for root, _dirnames, filenames in os.walk(PIC_DIR):
      for filename in filenames:
          ext = os.path.splitext(filename)[1].lower()
          if ext in extensions and not '.AppleDouble' in root and not filename.startswith('.'):
              file_path_name = os.path.join(root, filename)
              include_flag = True
              orientation = 1 # this is default - unrotated
              if EXIF_DATID is not None and EXIF_ORIENTATION is not None:
                try:
                  im = Image.open(file_path_name) # lazy operation so shouldn't load (better test though)
                  #print(filename, end="")
                  exif_data = im._getexif()
                  print('orientation is {}'.format(exif_data[EXIF_ORIENTATION]))
                  dt = time.mktime(
                        time.strptime(exif_data[EXIF_DATID], '%Y:%m:%d %H:%M:%S'))
                  orientation = int(exif_data[EXIF_ORIENTATION])
                except Exception as e: # NB should really check error here but it's almost certainly due to lack of exif data
                  print(e)
                  dt = os.path.getmtime(file_path_name) # so use file last modified date
                if (dt_from is not None and dt < dt_from) or (dt_to is not None and dt > dt_to):
                  include_flag = False
              if include_flag:
                file_list.append((file_path_name, orientation)) # iFiles now list of tuples (file_name, orientation) 
  if shuffle:
    random.shuffle(file_list) # randomize pictures
  else:
    file_list.sort() # if not suffled; sort by name
  return file_list, len(file_list) # tuple of file list, number of pictures

EXIF_DATID = None # this needs to be set before get_files() above can extract exif date info
EXIF_ORIENTATION = None
for k in ExifTags.TAGS:
  if ExifTags.TAGS[k] == 'DateTimeOriginal':
    EXIF_DATID = k
  if ExifTags.TAGS[k] == 'Orientation':
    EXIF_ORIENTATION = k


##############################################
# MQTT functionality - see https://www.thedigitalpictureframe.com/
##############################################
if USE_MQTT:
  try:
    import paho.mqtt.client as mqtt
    def on_connect(client, userdata, flags, rc):
      print("Connected to MQTT broker")

    def on_message(client, userdata, message):
      # TODO not ideal to have global but probably only reasonable way to do it
      global next_pic_num, iFiles, nFi, date_from, date_to, time_delay
      global delta_alpha, fade_time, shuffle, quit, paused, nexttm
      msg = message.payload.decode("utf-8")
      reselect = False
      if message.topic == "frame/date_from": # NB entered as mqtt string "2016:12:25"
        df = msg.split(":")
        date_from = tuple(int(i) for i in df)
        reselect = True
      elif message.topic == "frame/date_to":
        df = msg.split(":")
        date_to = tuple(int(i) for i in df)
        reselect = True
      elif message.topic == "frame/time_delay":
        time_delay = float(msg)
      elif message.topic == "frame/fade_time":
        fade_time = float(msg)
        delta_alpha = 1.0 / (FPS * fade_time)
      elif message.topic == "frame/shuffle":
        shuffle = True if msg == "True" else False
        reselect = True
      elif message.topic == "frame/quit":
        quit = True
      elif message.topic == "frame/paused":
        paused = not paused # toggle from previous value
      elif message.topic == "frame/back":
        next_pic_num -= 2
        if next_pic_num < -1:
          next_pic_num = -1
        nexttm = time.time() - 1.0
      if reselect:
        iFiles, nFi = get_files(date_from, date_to)
        next_pic_num = 0

    # set up MQTT listening
    client = mqtt.Client()
    client.username_pw_set("orhellow", "z6kfIctiONxP") # replace with your own id
    client.connect("postman.cloudmqtt.com", 16845, 60) # replace with your own server
    client.loop_start()
    client.subscribe("frame/date_from", qos=0)
    client.subscribe("frame/date_to", qos=0)
    client.subscribe("frame/time_delay", qos=0)
    client.subscribe("frame/fade_time", qos=0)
    client.subscribe("frame/shuffle", qos=0)
    client.subscribe("frame/quit", qos=0)
    client.subscribe("frame/paused", qos=0)
    client.subscribe("frame/back", qos=0)
    client.on_connect = on_connect
    client.on_message = on_message
  except Exception as e:
    print("MQTT not set up because of: {}".format(e))
##############################################

DISPLAY = pi3d.Display.create(x=20,y=20,frames_per_second=FPS, background=BACKGROUND)
CAMERA = pi3d.Camera(is_3d=False)

shader = pi3d.Shader("/home/patrick/python/pi3d_demos/shaders/blend_new")
slide = pi3d.Sprite(camera=CAMERA, w=DISPLAY.width, h=DISPLAY.height, z=5.0)
slide.set_shader(shader)
slide.unif[47] = EDGE_ALPHA

kbd = pi3d.Keyboard()

# images in iFiles list
nexttm = 0.0
iFiles, nFi = get_files(date_from, date_to)
next_pic_num = 0
sfg = None # slide for background
sbg = None # slide for foreground
if nFi == 0:
  print('No files selected!')
  exit()

# PointText and TextBlock
font = pi3d.Font(FONT_FILE, codepoints=CODEPOINTS, grid_size=7, shadow_radius=4.0,
                 shadow=(0,0,0,128))
text = pi3d.PointText(font, CAMERA, max_chars=200, point_size=50)
textblock = pi3d.TextBlock(x=-DISPLAY.width * 0.5 + 50, y=-DISPLAY.height * 0.4,
                           z=0.1, rot=0.0, char_count=199,
                           text_format="{}".format(tidy_name(iFiles[next_pic_num][0])), size=0.99, 
                           spacing="F", space=0.02, colour=(1.0, 1.0, 1.0, 1.0))
text.add_text_block(textblock)

num_run_through = 0
while DISPLAY.loop_running():
  tm = time.time()
  if nFi > 0:
    if tm > nexttm and not paused: # this must run first iteration of loop
      nexttm = tm + time_delay
      a = 0.0 # alpha - proportion front image to back
      sbg = sfg
      sfg = None
      while sfg is None: # keep going through until a usable picture is found TODO break out how?
        pic_num = next_pic_num
        sfg = tex_load(*iFiles[pic_num]) # '*' here splits tuple into two values
        next_pic_num += 1
        if next_pic_num >= nFi:
          num_run_through += 1
          if shuffle and num_run_through >= RESHUFFLE_NUM:
            num_run_through = 0
            random.shuffle(iFiles)
          next_pic_num = 0
      if sbg is None: # first time through
        sbg = sfg
      slide.set_textures([sfg, sbg])
      slide.unif[45:47] = slide.unif[42:44] # transfer front width and height factors to back
      slide.unif[51:53] = slide.unif[48:50] # transfer front width and height offsets
      wh_rat = (DISPLAY.width * sfg.iy) / (DISPLAY.height * sfg.ix)
      if (wh_rat > 1.0 and FIT) or (wh_rat <= 1.0 and not FIT):
        sz1, sz2, os1, os2 = 42, 43, 48, 49
      else:
        sz1, sz2, os1, os2 = 43, 42, 49, 48
        wh_rat = 1.0 / wh_rat
      slide.unif[sz1] = wh_rat
      slide.unif[sz2] = 1.0
      slide.unif[os1] = (wh_rat - 1.0) * 0.5
      slide.unif[os2] = 0.0
      # set the file name as the description
      textblock.set_text(text_format="{}".format(tidy_name(iFiles[pic_num][0])))
      text.regen()

    if a < 1.0:
      a += delta_alpha
      slide.unif[44] = a
      # this sets alpha for the TextBlock from 0 to 1 then back to 0
      textblock.colouring.set_colour(alpha=(1.0 - abs(1.0 - 2.0 * a)))
      text.regen()

    slide.draw()

  else:
    textblock.set_text("NO IMAGES SELECTED")
    textblock.colouring.set_colour(alpha=1.0)
    text.regen()

  text.draw()

  k = kbd.read()
  if k != -1:
    nexttm = time.time() - 1.0
  if k==27 or quit: #ESC
    break
  if k==ord(' '):
    paused = not paused
  if k==ord('s'): # go back a picture
    next_pic_num -= 2
    if next_pic_num < -1:
      next_pic_num = -1

try:
  client.loop_stop()
except Exception as e:
  print("this was going to fail if previous try failed!")
kbd.close()
DISPLAY.destroy()
This the diff - as you can see, not too much changed.

Code: Select all

 diff PictureFrame.py PictureFrame_rotate.py
10a11,12
> USING exif info to rotate images
> 
50c52
< def tex_load(fname):
---
> def tex_load(fname, orientation):
52c54,61
<     tex = pi3d.Texture(fname, blend=True, m_repeat=True)
---
>     im = Image.open(fname)
>     if orientation > 4: # this is a rotated image)
>       im = im.transpose(Image.ROTATE_270)
>     if orientation in [2, 4, 5, 8]:
>       im = im.transpose(Image.FLIP_LEFT_RIGHT)
>     if orientation in [4, 8]:
>       im = im.transpose(Image.FLIP_TOP_BOTTOM)
>     tex = pi3d.Texture(im, blend=True, m_repeat=True)
79c88,89
<               if EXIF_DATID is not None and (dt_from is not None or dt_to is not None):
---
>               orientation = 1 # this is default - unrotated
>               if EXIF_DATID is not None and EXIF_ORIENTATION is not None:
82a93,94
>                   exif_data = im._getexif()
>                   print('orientation is {}'.format(exif_data[EXIF_ORIENTATION]))
84c96,97
<                         time.strptime(im._getexif()[EXIF_DATID], '%Y:%m:%d %H:%M:%S'))
---
>                         time.strptime(exif_data[EXIF_DATID], '%Y:%m:%d %H:%M:%S'))
>                   orientation = int(exif_data[EXIF_ORIENTATION])
91c104
<                 file_list.append(file_path_name) 
---
>                 file_list.append((file_path_name, orientation)) # iFiles now list of tuples (file_name, orientation) 
98a112
> EXIF_ORIENTATION = None
102c116,118
<     break
---
>   if ExifTags.TAGS[k] == 'Orientation':
>     EXIF_ORIENTATION = k
> 
193c209
<                            text_format="{}".format(tidy_name(iFiles[next_pic_num])), size=0.99, 
---
>                            text_format="{}".format(tidy_name(iFiles[next_pic_num][0])), size=0.99, 
208c224
<         sfg = tex_load(iFiles[pic_num])
---
>         sfg = tex_load(*iFiles[pic_num]) # '*' here splits tuple into two values
232c248
<       textblock.set_text(text_format="{}".format(tidy_name(iFiles[pic_num])))
---
>       textblock.set_text(text_format="{}".format(tidy_name(iFiles[pic_num][0])))
Let me know if you've got any questions.

Paddy
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

sunilammanabrolu
Posts: 3
Joined: Fri Sep 06, 2019 5:24 pm

Re: Image viewer with transition between images

Sun Sep 08, 2019 7:08 am

Thanks @paddyg for the quick help and support. This version works perfectly for me.
I am facing another problem while trying to run the script using a cron job.
I have created a file SlideShow.sh with below line

Code: Select all

python3 /home/pi/pi3d_demos/PictureFrame.py
Added below line to crontab

Code: Select all

@reboot /home/pi/SlideShow.sh >> /home/pi/logs/cron.log 2>&
Script execution failed with below error

Code: Select all

Traceback (most recent call last):
  File "PictureFrame.py", line 191, in <module>
    kbd = pi3d.Keyboard()
  File "/usr/local/lib/python3.7/dist-packages/pi3d/Keyboard.py", line 257, in Keyboard
    return CursesKeyboard() if use_curses else SysKeyboard()
  File "/usr/local/lib/python3.7/dist-packages/pi3d/Keyboard.py", line 18, in __init__
    self.key = curses.initscr()
  File "/usr/lib/python3.7/curses/__init__.py", line 30, in initscr
    fd=_sys.__stdout__.fileno())
_curses.error: setupterm: could not find terminal
Then I added below lines to SlideShow.sh (Found a stackoverflow solution for this error)

Code: Select all

export TERM=linux
export TERMINFO=/etc/terminfo
With this, I see a different error

Code: Select all

Traceback (most recent call last):
  File "PictureFrame.py", line 191, in <module>
    kbd = pi3d.Keyboard()
  File "/usr/local/lib/python3.7/dist-packages/pi3d/Keyboard.py", line 257, in Keyboard
    return CursesKeyboard() if use_curses else SysKeyboard()
  File "/usr/local/lib/python3.7/dist-packages/pi3d/Keyboard.py", line 19, in __init__
    curses.cbreak()
_curses.error: cbreak() returned ERR
I believe the error is thrown because we are not running the script on a terminal but trying to run in background. But I am not able to figure out a solution

User avatar
paddyg
Posts: 2422
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Image viewer with transition between images

Sun Sep 08, 2019 11:24 am

@sunilammanabrolu it's *so* frustrating not being able to get applications to run simply when the computer boots. There are so many alternatives and even more critical variables! When @saphno and I were ironing out some issues with the RPi4 and getting pi3d to use the new graphics driver, we noticed that the cron system seemed to have stopped working. I found that putting the following into
/home/pi/.bashrc
worked most reliably

Code: Select all

cd /home/pi/pi3d_demos/
/usr/bin/python3 /home/pi/pi3d_demos/PictureFrame.py
You also need to have the original, legacy non-GL desktop driver and set the Pi not to start the X11 desktop driver (aka to command line), both done with
sudo raspi-config

Have a go at that, but the other thing I noticed is that your error comes from trying to run curses which is really only used by pi3d for keyboard input. If you are running the display headless then you could comment out all the key reading.

Paddy
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

sunilammanabrolu
Posts: 3
Joined: Fri Sep 06, 2019 5:24 pm

Re: Image viewer with transition between images

Sun Sep 08, 2019 5:37 pm

paddyg wrote:
Sun Sep 08, 2019 11:24 am

Have a go at that, but the other thing I noticed is that your error comes from trying to run curses which is really only used by pi3d for keyboard input. If you are running the display headless then you could comment out all the key reading.

Paddy
Thanks @paddyg. I will try this

basm
Posts: 4
Joined: Wed Sep 25, 2019 10:26 pm

Re: Image viewer with transition between images

Wed Sep 25, 2019 10:30 pm

To fix running the script unattended as a backgroudn proces from cron, I added configuration setting (which was there before) to disable keyboard usage. See: https://github.com/basmeerman/pi3d_demo ... reFrame.py

Furthermore I was looking into the image rotation but could not find code in the examples 3 posts above where the actual orientation of the image is changes (after studying the diff). Could anyone please advice.

Thanks.

User avatar
paddyg
Posts: 2422
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Image viewer with transition between images

Thu Sep 26, 2019 5:53 pm

Hi Thanks for that. I'm away from computer at the moment so can't do much to help. In the post with the diff, the revised version of the file is above it in full. Each section of the diff has the line numbers before and after the change. They're quite hard to read but maybe Google it. In a few days I will be back and will tidy all this up and put a new version on GitHub.

Paddy
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
paddyg
Posts: 2422
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Image viewer with transition between images

Sat Sep 28, 2019 11:26 pm

@basm, in your modified code these are the places the images would be rotated:
here the orientation is found from the exif data
here you see that the returned file list is now a list of tuples which include orientation
in the main loop here tex_load is called, the * splits the tuple into the two arguements required by the revised tex_load function
and this is where the actual rotation is done using the PIL.Image transformation functions

Hope this helps

Paddy
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

basm
Posts: 4
Joined: Wed Sep 25, 2019 10:26 pm

Re: Image viewer with transition between images

Sun Sep 29, 2019 9:23 pm

paddyg: Thank you. It works.

User avatar
sapnho
Posts: 216
Joined: Sun Sep 14, 2014 3:49 pm
Location: Frankfurt am Main
Contact: Website

Re: Image viewer with transition between images

Mon Sep 30, 2019 7:39 am

Hi @paddyg,

I had one guy having a problem installing the latest Pi3D on a Raspberry Pi Zero and we never had this error message before (latest Buster).
sudo pip3 install pi3d wget https://github.com/pi3d/pi3d_demos/archive/master.zip && unzip master.zip && rm master.zip && mv pi3d_demos-master pi3d_demos
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting https://github.com/pi3d/pi3d_demos/archive/master.zip
Downloading https://github.com/pi3d/pi3d_demos/archive/master.zip
/ 89.1MB 624kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.7/tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-x2fejtjq/setup.py'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-x2fejtjq/
Any idea where we could look at? Thanks!
www.TheDigitalPictureFrame.com
Build a really great digital picture frame with the Raspberry Pi.
With lots of great tips from this forum.

User avatar
paddyg
Posts: 2422
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Image viewer with transition between images

Mon Sep 30, 2019 8:04 am

Hi, I will have a go installing on a fresh latest buster as in case something has changed. It looks like the download and unpacking into the /tmp/ folder didn't work properly for some reason.

Did they retry just the pip3 bit?

On my (Ubuntu) laptop I find I have to use
pip3 install xyz --user
Instead of sudo, which always used to work.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
paddyg
Posts: 2422
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Image viewer with transition between images

Mon Sep 30, 2019 11:17 am

Hi @sapnho, Just tried a new buster SD and pi3d installed OK. Provisos:

1. I used the full fat 2019-07-10-raspbian-buster.zip and etcher
2. I started with the SD card in a RPi zero W but it took so long I unplugged it from the power and put the card into a RPi 3
3. I told it Not to do the first start checking for updates but opened a terminal window and manually sudo apt-get update/upgrade which also took ages (an hour or two? I went off and did various other jobs so not sure how long exactly. It looks like it's high time for the raspbian maintaianers a new version of the image in downloads or just never use the full fat version, start with lite and add what you need.)
4. I just did sudo pip3 install pi3d without chaining the wget demos.

Let me know if the problem persists.

Paddy

PS just checking you site to see what version of raspbian you recommend and I see that your code formatting might have got scrambled where you talk about editing PictureFrame.py - don't know why wordpress has to make the css so complicated!)
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

twowheelrose
Posts: 2
Joined: Wed Nov 13, 2019 5:01 pm

Re: Image viewer with transition between images

Wed Nov 13, 2019 7:54 pm

I am leveraging Pi3D for a digital photo frame capability and I am having issues displaying portrait images.. I am running Buster on a RPI4 the OS as well as Pi3D are fresh bits as of today. I followed the instructions on https://www.thedigitalpictureframe.com/ ... sing-pi3d/

Portrait images are cut off and seem to be showing just the center portion of the image. This happens even after I have formatted the images to be no 'taller' than 'W' x 1200 pix. Other non-standard aspect ration image sizes are not 'fitting' either. It seems as if the images are displaying in their original size and not displaying to their new size that I set manually.

All of my landscape photos are showing up perfectly and the transitions are beautiful. I have received a number fo compliments on it and I wanted to share that with you. Thank you for creating a wonderful app!

Thank you for any guidance to help resolve.

User avatar
paddyg
Posts: 2422
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Image viewer with transition between images

Wed Nov 13, 2019 11:27 pm

Hi, Sorry you're having difficulty. There's so much in that PictureFrame script now that it's pretty hard to set it all up (though sapnho's web site is very good). The first thing that occurs to me is the FIT option. True means that all the image is visible even if there are gaps (which will be filled in with mirrored versions of the main picture - greyed out - by default) sapnho sets this to False in his instructions which leaves no gaps but chops off the parts of the image that don't fit the screen. The second thing would be the EXIF rotation functionality but at the moment that is only in PictureFrame_rotate.py in the develop branch of pi3d so less likely to be that unless you're being adventurous (though I'm going to push out a new version of pi3d tonight and it will go live then!) The final option would be that something is broken, in which case I will need a copy of your version of PictureFrame.py to see what's going wrong.

Paddy

EDIT: as of late o'clock Wed v2.33 is on pypi.python.org and will be installed if you pip3 install pi3d and pi3d_demos has the EXIF date and rotation functionality in PictureFrame.py
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
sapnho
Posts: 216
Joined: Sun Sep 14, 2014 3:49 pm
Location: Frankfurt am Main
Contact: Website

Re: Image viewer with transition between images

Thu Nov 14, 2019 9:52 am

@paddyg, when I enter

Code: Select all

[email protected]:~ $ sudo pip3 install pi3d
I still get 2.32
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pi3d in /usr/local/lib/python3.7/dist-packages (2.32)
Anything I am doing wrong?
www.TheDigitalPictureFrame.com
Build a really great digital picture frame with the Raspberry Pi.
With lots of great tips from this forum.

User avatar
sapnho
Posts: 216
Joined: Sun Sep 14, 2014 3:49 pm
Location: Frankfurt am Main
Contact: Website

Re: Image viewer with transition between images

Thu Nov 14, 2019 9:55 am

I can answer that myself. I need to

Code: Select all

sudo pip3 install pi3d --upgrade
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pi3d
Downloading https://files.pythonhosted.org/packages ... ne-any.whl (265kB)
100% |████████████████████████████████| 266kB 1.1MB/s
Installing collected packages: pi3d
Found existing installation: pi3d 2.32
Uninstalling pi3d-2.32:
Successfully uninstalled pi3d-2.32
Successfully installed pi3d-2.33
Thanks for the great update, Paddy. I will shortly dedicate an article on the most recent changes. There's more than the eye can see! :-)
www.TheDigitalPictureFrame.com
Build a really great digital picture frame with the Raspberry Pi.
With lots of great tips from this forum.

User avatar
sapnho
Posts: 216
Joined: Sun Sep 14, 2014 3:49 pm
Location: Frankfurt am Main
Contact: Website

Re: Image viewer with transition between images

Thu Nov 14, 2019 9:55 am

I can answer that myself. I need to

Code: Select all

sudo pip3 install pi3d --upgrade
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pi3d
Downloading https://files.pythonhosted.org/packages ... ne-any.whl (265kB)
100% |████████████████████████████████| 266kB 1.1MB/s
Installing collected packages: pi3d
Found existing installation: pi3d 2.32
Uninstalling pi3d-2.32:
Successfully uninstalled pi3d-2.32
Successfully installed pi3d-2.33
Thanks for the great update, Paddy. I will shortly dedicate an article on the most recent changes. There's more than the eye can see! :-)
www.TheDigitalPictureFrame.com
Build a really great digital picture frame with the Raspberry Pi.
With lots of great tips from this forum.

User avatar
paddyg
Posts: 2422
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Image viewer with transition between images

Thu Nov 14, 2019 10:22 am

Glad you sorted it.. let me know if anything is broken (hopefully not)

Another thing about pip that I've found is that it sometimes gets in a tangle with sudo. The problem is that things get installed for root and then there are subsequent permission issues. The best way (that I have found) is to use --user. i.e.

Code: Select all

$ pip3 install pi3d --user
and subsequently

Code: Select all

$ pip3 install pi3d --upgrade --user
Also if the EXIF reading occasionally goes wrong with PIL using the version that comes with Raspbian buster I suggest

Code: Select all

$ pip3 install Pillow --upgrade --user
and often there is a complaint about the version of pip itself after you run it, with a suggested command line update command, I add --user to the end of that now, rather than putting sudo at the start

Code: Select all

$ pip3 install pip --upgrade --user
(I won't go into all the unnecessary complications of py2 v py3. Why 'pip3 install pip', 'pip3 install pip3', 'pip install pip3' etc!!)
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

twowheelrose
Posts: 2
Joined: Wed Nov 13, 2019 5:01 pm

Re: Image viewer with transition between images

Wed Nov 20, 2019 3:02 pm

just wanted to say thank you! it is working fantastically. I also upgraded and its full of amazingness. cheers

User avatar
sapnho
Posts: 216
Joined: Sun Sep 14, 2014 3:49 pm
Location: Frankfurt am Main
Contact: Website

Re: Image viewer with transition between images

Fri Nov 22, 2019 8:10 pm

Paddy's latest Pi3D update is another great improvement. I have explained the various settings and functionalities here: https://www.thedigitalpictureframe.com/ ... -nov-2019/

Thanks so much, Paddy!
www.TheDigitalPictureFrame.com
Build a really great digital picture frame with the Raspberry Pi.
With lots of great tips from this forum.

Return to “General discussion”