Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling Camera#file fails for queued calls #12

Open
Sija opened this issue Jul 25, 2016 · 3 comments
Open

Calling Camera#file fails for queued calls #12

Sija opened this issue Jul 25, 2016 · 3 comments

Comments

@Sija
Copy link
Owner

Sija commented Jul 25, 2016

It happens when (there's no SD card inside? and) we try to use CameraFile which might be unavailable at the time.

Below test code:

queue = [] of CameraFile
# ...
queue.each &.save

Results in:

Unspecified error (GPhoto2::Error)
[4491010242] *CallStack::unwind:Array(Pointer(Void)) +82
[4491010145] *CallStack#initialize:Array(Pointer(Void)) +17
[4491010104] *CallStack::new:CallStack +40
[4490990009] *raise<GPhoto2::Error>:NoReturn +25
[4491164503] *GPhoto2::check!<Int32>:Int32 +919
[4491237226] *GPhoto2::Camera@GPhoto2::Camera::Filesystem#file_get<GPhoto2::CameraFile, LibGPhoto2::CameraFileType>:GPhoto2::CameraFile +250
[4491236967] *GPhoto2::Camera@GPhoto2::Camera::Filesystem#file_get<GPhoto2::CameraFile>:GPhoto2::CameraFile +39
[4491236921] *GPhoto2::Camera@GPhoto2::Camera::Filesystem#file<GPhoto2::CameraFile>:GPhoto2::CameraFile +9
[4491425206] *GPhoto2::CameraFile#data_and_size:Tuple(Pointer(UInt8), UInt64) +134
[4491425040] *GPhoto2::CameraFile#data:Pointer(UInt8) +32
[4491424949] *GPhoto2::CameraFile#to_slice:Slice(UInt8) +21
[4491424546] *GPhoto2::CameraFile#save:Nil +130
[4490921895] __crystal_main +2583
[4490974088] main +40
@Sija Sija added the bug label Jul 25, 2016
@Sija
Copy link
Owner Author

Sija commented Jul 29, 2016

One way would be to call #data_and_size in CameraFile#initialize to load the data if @camera[:capturetarget]? == "Internal RAM" but it just feels hackish — for instance what about values from different cameras...?

@Sija
Copy link
Owner Author

Sija commented Dec 19, 2016

See gphoto/libgphoto2@14041e1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant