Coder Social home page Coder Social logo

Comments (9)

inobotica avatar inobotica commented on June 16, 2024 1

Jim thank you so much (for the help and the development of this library), now i am able to take pictures, modify them in RPi then save it back to the camera. This library is very usefull and easy to use.

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 16, 2024 1

I've just released version 1.5.0 which has the changed gp_file_open() as mentioned above.

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 16, 2024

I think gp_camera_folder_put_file() is the function you want. gp_file_open() should read your local file into a CameraFile object you can pass to gp_camera_folder_put_file().

from python-gphoto2.

inobotica avatar inobotica commented on June 16, 2024

Hi,

I have been working with the functions that you recommended me, but i am having problem with the creation of CameraFile object, it seems that i am not creating a correct CameraFile object and the gp_file_open() is not reading it throwing an error "Argument 1 of type CameraFile ". How i create a CameraFile object correctly?

here is my code:

def file_mover():
camera_file = gp.gp_file_new() # Create a CameraFile object
gp.gp_file_open(camera_file,name) # Pass the image (in RPi) to the CameraFile object
gp.check_result(gp.gp_camera_put_file(camera,folder,camera_file,context)) # Save the image in NIKON S3700 SDcard

Thanks for the help,

from python-gphoto2.

chrisimars avatar chrisimars commented on June 16, 2024

Hi, I am trying to download files from the camera not upload.
Thanks,
Chris

from python-gphoto2.

inobotica avatar inobotica commented on June 16, 2024

hi Chris,

use the capture-image.py example, you just have to change the target address of the file, in the line 45

gp.check_result(gp.gp_file_save(camera_file,'gphoto.jpg')) #this will save the gphoto.jpg in root of the pi

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 16, 2024

Chris, please don't change the subject of an "issue". If you have found a different bug in python-gphoto2 you should create a new issue for it.

Daniel, the gp_file_new() function returns an integer error code and the CameraFile object. Use check_result() to strip the error code and return just the CameraFile object. (In the next release of python-gphoto2 I'll make gp_file_open() allocate and return a new CameraFile object. This would be more consistent with the other functions.)

from python-gphoto2.

inobotica avatar inobotica commented on June 16, 2024

Good, im going to upgrade it, i have been problems writing back the images to the camera sometimes appears a (-7) I/O problem, sometimes writes without problem, according to what i have researched it seems to see permission issues, may be you wonder why?

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 16, 2024

Things that sometimes work and sometimes don't are hard to diagnose. The Raspberry Pi USB system has had problems in the past. If you can try a different sort of computer you might find it works OK.
I don't think many people write images back to the camera, so this part of libgphoto2 might not be well tested.

from python-gphoto2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.