akshayaurora / photolibrary

MIT License
1 stars 1 forks source link

Readme does not appear to reflect current code #1

Open gorgonaut04 opened 8 years ago

gorgonaut04 commented 8 years ago

I will soon be testing your implementation, but I was wondering if the Readme could be corrected (not sure which parts are incorrect; "photos" not declared, "pyPhotoLibrary" not declared anywhere in the repository):

from pyPhotoLibrary import Photos
photos.bind(
    on_image_captured=self.on_image_captured,
    on_capture_cancelled=self.on_capture_cancelled)
if photos.isCameraAvailable:
    photos.capture_image(filename)
else:
    photos.chooseFromGallery(filename)```
Baekalfen commented 3 years ago

In case somebody else stumbles onto this. This works:

from photolibrary import PhotosLibrary

def on_image_captured(photoslibrary):
    print("Image was successfully captured", photoslibrary)

def on_capture_cancelled(photoslibrary):
    print('Cancelled!', photoslibrary)

photos = PhotosLibrary()

if photos.isCameraAvailable:
    photos.capture_image(filename)
    photos.bind(
        on_image_captured=on_image_captured,
        on_capture_cancelled=on_capture_cancelled
    )
else:
    photos.chooseFromGallery(filename)