Comments (9)
Also, I tried your list_files
-Function to see the local files on the camera, but this always returns an empty array.
def list_files(camera, path="/"):
result = []
# get files
for name, value in camera.folder_list_files(path):
result.append(os.path.join(path, name))
# read folders
folders = []
for name, value in camera.folder_list_folders(path):
folders.append(name)
# recurse over subfolders
for name in folders:
result.extend(list_files(camera, os.path.join(path, name)))
return result
from python-gphoto2.
Very strange. I have no experience with Sony cameras, but I would expect this to work. Camera.file_delete
isn't expected to return anything - it should raise an exception if gp_camera_file_delete
(which it calls) returns an error. I assume by "nothing happens" you mean the image file remains on the camera SD card.
Check you have libusb1 installed - libusb0 is known to be problematic with some cameras. Other than that I have nothing to suggest.
BTW you can find out what version of libgphoto2 you are using with python -m gphoto2
.
from python-gphoto2.
PS Do you set the camera capture target (i.e. SD card or RAM) before calling list_files
? I don't know if it matters or not, but it might be worth checking.
from python-gphoto2.
Hi, thanks for the reply. Yes, it simply does not delete the file, I changed the title of this issue :-)
The output of python -m gphoto2
:
python-gphoto2 version: 2.3.4
libgphoto2 version: ['2.5.27', 'standard camlibs', 'gcc', 'ltdl', 'EXIF']
libgphoto2_port version: ['0.12.0', 'iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi', 'gcc', 'ltdl', 'EXIF', 'USB', 'serial without locking']
python-gphoto2 examples: /usr/local/lib/python3.9/dist-packages/gphoto2/examples
I tried the capturetarget
-option, but it seems, that I can't change it 🤔
![image](https://private-user-images.githubusercontent.com/1507474/251165882-6d506416-de99-434a-bcc1-c73aad4ae8c4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTY2NDMxNTYsIm5iZiI6MTcxNjY0Mjg1NiwicGF0aCI6Ii8xNTA3NDc0LzI1MTE2NTg4Mi02ZDUwNjQxNi1kZTk5LTQzNGEtYmNjMS1jNzNhYWQ0YWU4YzQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDUyNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA1MjVUMTMxNDE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDRmYTRkMTJlZjA2MjMzZDk3Y2ZhNmI1Njc5N2Y1YjVlMmJhYzc3Yjk1YzJkZDBkYTQ1NGNjNTUxMDhjYTJiYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.eiLIPwIKXlF11pI9LyHlXAnVoUoc-YbQMXyEOT-NCX8)
I have libusb-1.0.24-3 installed.
Still images are stored on the camera 😞
from python-gphoto2.
Setting the capture target may only last for the duration of a libgphoto2 session (i.e. until exit()
or the camera is reset). But as it's already set to card+sdram
then it's probably not the problem.
Libgphoto2 2.5.27 isn't ridiculously old (released Feb 2021). The release notes for 2.5.28 include "Sony: mark all widgets as read-write again, read-only logic was not 100% correct" which might explain your capture target setting problem. I can't find anything relevant to deleting pictures though.
from python-gphoto2.
Have you tried listing files and deleting files with the gphoto2
command? gphoto2 -v
will show which version of libghoto2 it's using - it isn't necessarily the same as used by python-gphoto2.
from python-gphoto2.
Ah, good point. gphoto2 can't even list my files via CLI. Maybe it's just a Sony thing. For my Customer we use Nikon cameras and it works on these cameras. I have no Nikon available currently, which is why I have to work on a Sony camera.
Strange, that this function does not work on a Sony camera.
$ gphoto2 --list-files
There is no file in folder '/'.
$ gphoto2 -v
gphoto2 2.5.27
Copyright (c) 2000-2021 Marcus Meissner and others
gphoto2 comes with NO WARRANTY, to the extent permitted by law. You may
redistribute copies of gphoto2 under the terms of the GNU General Public
License. For more information about these matters, see the files named COPYING.
This version of gphoto2 is using the following software versions and options:
gphoto2 2.5.27 gcc, popt(m), exif, cdk, aa, jpeg, readline
libgphoto2 2.5.27 standard camlibs, gcc, ltdl, EXIF
libgphoto2_port 0.12.0 iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, gcc, ltdl, EXIF, USB, serial without locking
from python-gphoto2.
Actually it seems like a problem with the Sony camera. I tested it on Nikon cameras, which worked as I expected it. Thanks for your help, so I'm closing this and leaving it with "My Sony a6500 simply does not support this" :-)
from python-gphoto2.
Just spotted this comment on a libgphoto2 bug report: "For Sony cameras, in pc control mode there is no folder access. It is only accessible in MTP/PTP mode." It might be relevant.
gphoto/libgphoto2#798
from python-gphoto2.
Related Issues (20)
- Missing pre-req's(?) after building libgphoto2 from source on Raspberry Pi HOT 3
- Can not set datetime on Canon EOS 1200D HOT 4
- equivalent of gphoto2 --reset HOT 1
- delete a file HOT 2
- gp_camera_get_single_config HOT 2
- Socket error after gp_camera_exit in windows/msys2 HOT 15
- Faster way to copy files from camera HOT 7
- Sony FX3 overshoot HOT 1
- Segmentation Fault segfault on gp.Camera.autodetect() on Github Actions Runner HOT 21
- LGPL vs. GPL license? HOT 8
- Test Virtual Camera HOT 4
- Missing bindings for gp_port_new, gp_port_open, and gp_port_reset? HOT 2
- capture_preview() broken in v2.5.0 HOT 4
- having trouble getting gphoto2 on rpi HOT 3
- use python-gphoto2 in Windows system HOT 1
- Always connected capture anytime HOT 1
- Github Actions Python 3.12 environment. HOT 1
- Is live data acquisition available in the library? HOT 1
- Error When Installing with "Local" libgphoto2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-gphoto2.