omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello β€” I'm @olemoritz on Twitter.


    photos.pick_image throws error

    Pythonista
    3
    4
    134
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ihf
      ihf last edited by

      This snippet from another script selects a photo in the library but gives an index error. Has this changed in the new beta?

      import photos, time
      def pick_image():
          data=photos.pick_image(raw_data=True)
          return data
      data=pick_image()
      time.sleep(1.)
      v=ui.View()
      
      
      Traceback (most recent call last):
        File "/private/var/mobile/Containers/Shared/AppGroup/228D1F3E-E592-4896-BBF5-D6EA74943D0D/Pythonista3/Documents/tmp.py", line 6, in <module>
          data=pick_image()
        File "/private/var/mobile/Containers/Shared/AppGroup/228D1F3E-E592-4896-BBF5-D6EA74943D0D/Pythonista3/Documents/tmp.py", line 4, in pick_image
          data=photos.pick_image(raw_data=True)
        File "/var/containers/Bundle/Application/2ED6F7E9-20E0-4979-9558-F1FDD9658AEB/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/pythonista/photos.py", line 54, in pick_image
          return return_list[0]
      IndexError: list index out of range
      
      
      omz 1 Reply Last reply Reply Quote 0
      • omz
        omz @ihf last edited by

        @ihf This seems like a regression in the beta, I'll look into it.

        ihf 1 Reply Last reply Reply Quote 0
        • ihf
          ihf @omz last edited by

          @omz Unfortunately, this error persists in the new beta.

          1 Reply Last reply Reply Quote 0
          • ccc
            ccc last edited by ccc

            When reporting bugs, it is helpful to know what latest beta means so the app provides an easy way to add that…

            1. Click the gear icon at the bottom of the file list.
            2. Scroll to the bottom of Settings.
            3. Click Copy Version Info.
            4. Paste into your bug report.

            πŸ˜‚ There is a bug in v3.4 (340008) that Copy Version Info does not work! πŸ˜‚

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors