phocoder-rails 0.0.41 → 0.0.42

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1,4 +1,4 @@
1
- 0.0.41
1
+ 0.0.42
2
2
 
3
3
 
4
4
 
@@ -31,7 +31,9 @@ class EncodableJob < ActiveRecord::Base
31
31
  img_params = params[:input]
32
32
  encodable = job.encodable
33
33
  end
34
- [:file_size,:width,:height,:taken_at,:lat,:lng,:saturated_pixels,:gauss].each do |att|
34
+ [:file_size,:width,:height,:taken_at,:lat,:lng,:saturated_pixels,:gauss,:bits_per_pixel,:camera_make,
35
+ :camera_model, :orientation, :exposure_time, :f_number, :iso_speed_rating, :exposure_bias_value,
36
+ :focal_length, :focal_length_in_35mm_film, :subsec_time].each do |att|
35
37
  setter = att.to_s + "="
36
38
  if encodable.respond_to? setter and !img_params[att].blank?
37
39
  encodable.send setter, img_params[att]
@@ -88,4 +90,4 @@ class EncodableJob < ActiveRecord::Base
88
90
 
89
91
 
90
92
 
91
- end
93
+ end
@@ -0,0 +1,29 @@
1
+ class AddExifDataToImageUploads < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :image_uploads, :bits_per_pixel, :integer
4
+ add_column :image_uploads, :camera_make, :string
5
+ add_column :image_uploads, :camera_model, :string
6
+ add_column :image_uploads, :orientation, :integer
7
+ add_column :image_uploads, :exposure_time, :string
8
+ add_column :image_uploads, :f_number, :string
9
+ add_column :image_uploads, :iso_speed_rating, :string
10
+ add_column :image_uploads, :exposure_bias_value, :string
11
+ add_column :image_uploads, :focal_length, :string
12
+ add_column :image_uploads, :focal_length_in_35mm_film, :string
13
+ add_column :image_uploads, :subsec_time, :integer
14
+ end
15
+
16
+ def self.down
17
+ remove_column :image_uploads, :subsec_time
18
+ remove_column :image_uploads, :focal_length_in_35mm_film
19
+ remove_column :image_uploads, :focal_length
20
+ remove_column :image_uploads, :exposure_bias_value
21
+ remove_column :image_uploads, :iso_speed_rating
22
+ remove_column :image_uploads, :f_number
23
+ remove_column :image_uploads, :exposure_time
24
+ remove_column :image_uploads, :orientation
25
+ remove_column :image_uploads, :camera_model
26
+ remove_column :image_uploads, :camera_make
27
+ remove_column :image_uploads, :bits_per_pixel
28
+ end
29
+ end
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended to check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(:version => 20111101024507) do
13
+ ActiveRecord::Schema.define(:version => 20120423030345) do
14
14
 
15
15
  create_table "encodable_jobs", :force => true do |t|
16
16
  t.string "encodable_type"
@@ -76,6 +76,17 @@ ActiveRecord::Schema.define(:version => 20111101024507) do
76
76
  t.string "upload_host"
77
77
  t.string "parent_type"
78
78
  t.string "encodable_status"
79
+ t.integer "bits_per_pixel"
80
+ t.string "camera_make"
81
+ t.string "camera_model"
82
+ t.integer "orientation"
83
+ t.string "exposure_time"
84
+ t.string "f_number"
85
+ t.string "iso_speed_rating"
86
+ t.string "exposure_bias_value"
87
+ t.string "focal_length"
88
+ t.string "focal_length_in_35mm_film"
89
+ t.integer "subsec_time"
79
90
  end
80
91
 
81
92
  create_table "images", :force => true do |t|
@@ -22,12 +22,45 @@ describe EncodableJob do
22
22
  end
23
23
 
24
24
  it "should fupdate inputs" do
25
- params = {:class=>"ImageUpload",:id=>1, :job=>{:id => 1},:input=>{:id=>1,:file_size=>2,:width=>2,:height=>2,:url=>"http://production.webapeel.com/octolabs/themes/octolabs/images/octologo.png"},:format=>"json" }
25
+ params = { :class=>"ImageUpload",
26
+ :id=>1,
27
+ :format=>"json",
28
+ :job=>{ :id => 1 },
29
+ :input=>{ :id=>1,
30
+ :file_size=>2,
31
+ :width=>2,
32
+ :height=>2,
33
+ :url=>"http://production.webapeel.com/octolabs/themes/octolabs/images/octologo.png",
34
+ :bits_per_pixel => "8",
35
+ :camera_make => "NIKON CORPORATION",
36
+ :camera_model => "NIKON D300",
37
+ :orientation => "1",
38
+ :exposure_time => "(1/60)",
39
+ :f_number => "16",
40
+ :iso_speed_rating => "200",
41
+ :exposure_bias_value => "(0/1)",
42
+ :focal_length => "20",
43
+ :focal_length_in_35mm_film => "30",
44
+ :subsec_time => "23"
45
+ },
46
+
47
+ }
26
48
  EncodableJob.update_from_phocoder(params);
27
49
 
28
50
  @image_upload.reload
29
51
  @image_upload.encodable_status.should == "ready"
30
52
  @image_upload.file_size.should == 2
53
+ @image_upload.bits_per_pixel.should == 8
54
+ @image_upload.camera_make.should == "NIKON CORPORATION"
55
+ @image_upload.camera_model.should == "NIKON D300"
56
+ @image_upload.orientation.should == 1
57
+ @image_upload.exposure_time.should == "(1/60)"
58
+ @image_upload.f_number.should == "16"
59
+ @image_upload.iso_speed_rating.should == "200"
60
+ @image_upload.exposure_bias_value.should == "(0/1)"
61
+ @image_upload.focal_length.should == "20"
62
+ @image_upload.focal_length_in_35mm_film.should == "30"
63
+ @image_upload.subsec_time.should == 23
31
64
  end
32
65
 
33
66
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phocoder-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 77
4
+ hash: 75
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 41
10
- version: 0.0.41
9
+ - 42
10
+ version: 0.0.42
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeremy Green
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-24 00:00:00 Z
18
+ date: 2012-04-23 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails
@@ -249,6 +249,7 @@ files:
249
249
  - spec/dummy/db/migrate/20110523165213_add_parent_type_to_image_uploads.rb
250
250
  - spec/dummy/db/migrate/20110523165522_create_encodable_jobs.rb
251
251
  - spec/dummy/db/migrate/20111101024507_create_images.rb
252
+ - spec/dummy/db/migrate/20120423030345_add_exif_data_to_image_uploads.rb
252
253
  - spec/dummy/db/schema.rb
253
254
  - spec/dummy/public/404.html
254
255
  - spec/dummy/public/422.html
@@ -334,6 +335,7 @@ test_files:
334
335
  - spec/dummy/db/migrate/20110523165213_add_parent_type_to_image_uploads.rb
335
336
  - spec/dummy/db/migrate/20110523165522_create_encodable_jobs.rb
336
337
  - spec/dummy/db/migrate/20111101024507_create_images.rb
338
+ - spec/dummy/db/migrate/20120423030345_add_exif_data_to_image_uploads.rb
337
339
  - spec/dummy/db/schema.rb
338
340
  - spec/engine_spec.rb
339
341
  - spec/helpers/phocoder_helper_spec.rb