libgphoto2 no longer returns empty listings after a failed folder query
A pull request written with Claude Code stops gphoto2 marking a camera folder as loaded before asking the camera, which left disconnected cameras looking empty.
Credits
- Source byline Sija Source ↗
Earliest dated source:
The full story
In libgphoto2, listing a folder with the camera disconnected returned a 'no device' error once and then an empty listing reported as success on every later call, because both caching layers marked the folder as loaded before asking the camera. Fixing that exposed other places in the PTP path handling that turned errors into 'not found'.
One was serious: the delete function never checked whether a file was found, so a file that was in the cache but no longer on the camera resolved to object 0xFFFFFFFF, and deleting that asks the camera to delete all objects. The pull request, generated with Claude Code, fixes these in separate commits and flags the delete fix as worth merging on its own.
How it was done
Tools
Themes
Loading themes…
Sources
From the maker's own write-up or code. We summarise what they report; we haven't tested it ourselves.
- libgphoto2: Do not return cached empty listings after a failed folder querySource byline: SijaPublished
The libgphoto2 pull request describing the bugs and fixes.