gphoto4ruby 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/CHANGELOG.rdoc +8 -5
  2. data/Rakefile +8 -0
  3. data/ext/gphoto2camera.c +22 -9
  4. metadata +7 -7
data/CHANGELOG.rdoc CHANGED
@@ -1,11 +1,14 @@
1
+ == 0.3.3
2
+
3
+ * Removed fake unknown type event catch when receiving file or folder created evt
4
+ * Fixed bug of segmentation fault when raising exception in wait
5
+
1
6
  == 0.3.2
2
7
 
3
8
  * Added setting and getting of GP_WIDGET_DATE type configs. Behavior is strange
4
- though. In nikon D80 config name "time":
5
- * libgphoto 2.4.2 -- able to read, but unable to set
6
- * libgphoto 2.4.6 -- able to set, but when reading keep getting value 3 hours
7
- earlier. For any camera time zone. But the value set is
8
- correctly applied to exif. So can be used somehow
9
+ though. In nikon D80 config name "time" can be set, but when reading keep
10
+ getting value 3 hours earlier. For any camera time zone. But the value set is
11
+ correctly applied to exif. So can be used somehow
9
12
 
10
13
  == 0.3.1
11
14
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
1
3
  require "rubygems"
2
4
  require "rake"
3
5
  require "rake/rdoctask"
@@ -14,3 +16,9 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
14
16
  rdoc.options << "--charset=UTF-8"
15
17
  rdoc.options << "--webcvs=http://github.com/lonelyelk/gphoto4ruby/tree/master"
16
18
  end
19
+
20
+ desc "Upload rdoc to RubyForge."
21
+
22
+ task :publish_rdoc => [:rdoc] do
23
+ exec "scp -r rdoc/* lonelyelk@rubyforge.org:/var/www/gforge-projects/gphoto4ruby"
24
+ end
data/ext/gphoto2camera.c CHANGED
@@ -42,6 +42,13 @@ VALUE rb_cGPhoto2ConfigurationError;
42
42
  } \
43
43
  }
44
44
 
45
+ #define RESULT_CHECK_EVENT(r,e) { \
46
+ if (r < 0) { \
47
+ free(e); \
48
+ rb_raise_gp_result(r); \
49
+ } \
50
+ }
51
+
45
52
  void camera_mark(GPhoto2Camera *c) {
46
53
  }
47
54
 
@@ -1107,10 +1114,19 @@ VALUE camera_create_folder(VALUE self, VALUE folder) {
1107
1114
  * Waits for an event from camera for specified amount of milliseconds.
1108
1115
  * Returns an instance of GPhoto2::CameraEvent. When capturing image manually
1109
1116
  * with camera connected through USB, images are not saved on memory card
1110
- * until you call this method. During tests EVENT_TYPE_FILE_ADDED event
1117
+ * until you call this method.
1118
+ *
1119
+ * NOTE: During tests on Nikon D80 EVENT_TYPE_FILE_ADDED event
1111
1120
  * was always followed by EVENT_TYPE_UNKNOWN. So in the case of
1112
- * EVENT_TYPE_FILE_ADDED or EVENT_TYPE_FOLDER_ADDED, an extra call is made
1113
- * with 100ms timeout which result is ignored.
1121
+ * EVENT_TYPE_FILE_ADDED, an extra call should be
1122
+ * made with 100ms timeout which result is ignored.
1123
+ *
1124
+ * NOTE: During tests on Nikon D80, when captured each 1000 images, there are
1125
+ * two EVENT_TYPE_FILE_ADDED events: one with new folder name and another with
1126
+ * file name. Also each of them is followed by EVENT_TYPE_UNKNOWN.
1127
+ *
1128
+ * NOTE: Base C function gp_camera_wait_for_event is considered in development
1129
+ * and may change its behavior, so will this function.
1114
1130
  *
1115
1131
  * When image is captured manually and then event is caught, camera virtual
1116
1132
  * folder is changed to the one where files are saved.
@@ -1131,8 +1147,7 @@ VALUE camera_create_folder(VALUE self, VALUE folder) {
1131
1147
  VALUE camera_wait(int argc, VALUE *argv, VALUE self) {
1132
1148
  GPhoto2Camera *c;
1133
1149
  GPhoto2CameraEvent *ce;
1134
- CameraEventType fakeType;
1135
- void *evtData, *fakeData;
1150
+ void *evtData;
1136
1151
  int to;
1137
1152
 
1138
1153
  switch (argc) {
@@ -1150,18 +1165,16 @@ VALUE camera_wait(int argc, VALUE *argv, VALUE self) {
1150
1165
  Data_Get_Struct(self, GPhoto2Camera, c);
1151
1166
  ce = (GPhoto2CameraEvent*) malloc(sizeof(GPhoto2CameraEvent));
1152
1167
 
1153
- gp_result_check(gp_filesystem_reset(c->camera->fs));
1154
- gp_result_check(gp_camera_wait_for_event(c->camera, to, &(ce->type), &evtData, c->context));
1168
+ // RESULT_CHECK_EVENT(gp_filesystem_reset(c->camera->fs), ce);
1169
+ RESULT_CHECK_EVENT(gp_camera_wait_for_event(c->camera, to, &(ce->type), &evtData, c->context), ce);
1155
1170
 
1156
1171
  switch (ce->type) {
1157
1172
  case GP_EVENT_FILE_ADDED:
1158
1173
  case GP_EVENT_FOLDER_ADDED:
1159
1174
  ce->path = (CameraFilePath*)evtData;
1160
1175
  strcpy(c->virtFolder, ce->path->folder);
1161
- gp_result_check(gp_camera_wait_for_event(c->camera, 100, &fakeType, &fakeData, c->context));
1162
1176
  break;
1163
1177
  case GP_EVENT_UNKNOWN:
1164
- gp_result_check(gp_camera_wait_for_event(c->camera, 100, &fakeType, &fakeData, c->context));
1165
1178
  break;
1166
1179
  default:
1167
1180
  break;
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gphoto4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
- - heq4 company
7
+ - neq4 company
8
8
  - Sergey Kruk
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-06-11 00:00:00 +04:00
13
+ date: 2009-06-15 00:00:00 +04:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
@@ -34,11 +34,9 @@ files:
34
34
  - LICENSE
35
35
  - README.rdoc
36
36
  - Rakefile
37
- - docs
38
37
  - docs/COPYING
39
38
  - docs/COPYING.LESSER
40
39
  - example.rb
41
- - ext
42
40
  - ext/extconf.rb
43
41
  - ext/gphoto4ruby.c
44
42
  - ext/gphoto2camera.c
@@ -49,6 +47,8 @@ files:
49
47
  - ext/gphoto2camera_utilities.h
50
48
  has_rdoc: true
51
49
  homepage: http://github.com/lonelyelk/gphoto4ruby
50
+ licenses: []
51
+
52
52
  post_install_message:
53
53
  rdoc_options:
54
54
  - --main
@@ -74,9 +74,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  requirements: []
75
75
 
76
76
  rubyforge_project: gphoto4ruby
77
- rubygems_version: 1.2.0
77
+ rubygems_version: 1.3.5
78
78
  signing_key:
79
- specification_version: 2
79
+ specification_version: 3
80
80
  summary: GPhoto4Ruby is Ruby wrapping around gphoto2 C library
81
81
  test_files: []
82
82