omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. secepar

    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.


    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    secepar

    @secepar

    0
    Reputation
    326
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    secepar Unfollow Follow

    Latest posts made by secepar

    • RE: Saving camera photo to local folder

      That works. Thanks.

      posted in Pythonista
      secepar
      secepar
    • Saving camera photo to local folder

      Hi,

      I think it is a simple task. I have a button action to take a photo and save it to the local folder as well as the camera roll.

      def take_front_action(sender):
      	console.alert("Take front image", "", "OK")
      	front_image=photos.capture_image()
      	photos.save_image(front_image) #saving to camera roll working fine
      	last_asset=photos.get_assets()[-1]
      	img=last_asset.get_image()
      	front_filename=str(ObjCInstance(last_asset).valueForKey_('filename'))
      	with open(front_filename, 'wb') as out_file:
      		out_file.write(img)
      

      My code is giving me the following error:
      a bytes-linked object is required, not 'Image' or
      a bytes-linked object is required, not 'JpegImageFile',
      Depending on what I put inside 'img', 'last_asset' or 'front_image'in write().

      I think I'm not so clear what file format I'm getting in each function call. Hence the error.

      Any help will be greatly appreciated. Many thanks in advance.

      Sec

      posted in Pythonista
      secepar
      secepar