zooniverse_data 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd303857df8127a8118954196b758656650d3291
|
4
|
+
data.tar.gz: 26d09a57b5df5c2d939487f7df476c1d4c0e28cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 483e7ce5816eac80c091acbc731360e16493556a52ef9f66dc594da624898b8c93cf69ad78bf6b5d7c9dd09e54a54bc99fdad6773faf2cc1410aeb3473118f96
|
7
|
+
data.tar.gz: c9640f1efb5f331ff8f748220310031167b81a726541ef838519acd8630f50567e2c2d93b701d6fbfb689d7042b6ab3093d6db844aa877ec39d21cab38fe5f4a
|
@@ -23,7 +23,7 @@ module ZooniverseData
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def upload(from: nil, to: nil, content_type: nil)
|
26
|
-
content_type ||= `file
|
26
|
+
content_type ||= `file --brief --mime '#{ from }'`.chomp.split(';').first
|
27
27
|
path = [bucket_path, to].compact.join('/').gsub(/^\//, '').gsub '//', '/'
|
28
28
|
obj = bucket.objects[path]
|
29
29
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module ZooniverseData
|
2
|
+
module Projects
|
3
|
+
class Penguin
|
4
|
+
include Helpers
|
5
|
+
|
6
|
+
def customize_subject
|
7
|
+
original = convert_image(entry.location['standard'])
|
8
|
+
dimensions = original.input_image.size rescue OpenStruct.new(width: nil, height: nil)
|
9
|
+
resized = original.resize(width: 1_000, height: 1_000, force: false)
|
10
|
+
.quality(80)
|
11
|
+
.write_to(prefix: 'resized')
|
12
|
+
.path
|
13
|
+
entry.update :$set => {
|
14
|
+
'location.standard' => resized,
|
15
|
+
'metadata.original_size' => { width: dimensions.width, height: dimensions.height }
|
16
|
+
}
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zooniverse_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Parrish
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- lib/zooniverse_data/projects/condor.rb
|
117
117
|
- lib/zooniverse_data/projects/default.rb
|
118
118
|
- lib/zooniverse_data/projects/milky_way.rb
|
119
|
+
- lib/zooniverse_data/projects/penguin.rb
|
119
120
|
- lib/zooniverse_data/projects/serengeti.rb
|
120
121
|
- lib/zooniverse_data/projects/sunspot.rb
|
121
122
|
- lib/zooniverse_data/version.rb
|
@@ -140,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
141
|
version: '0'
|
141
142
|
requirements: []
|
142
143
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.2.
|
144
|
+
rubygems_version: 2.2.2
|
144
145
|
signing_key:
|
145
146
|
specification_version: 4
|
146
147
|
summary: Zooniverse data library
|