bulldog 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +12 -0
- data/VERSION +1 -1
- data/bulldog.gemspec +2 -2
- data/lib/bulldog/attachment/has_dimensions.rb +1 -1
- data/lib/bulldog/attachment/image.rb +2 -2
- data/lib/bulldog/attachment/pdf.rb +2 -2
- data/lib/bulldog/attachment/video.rb +1 -1
- data/lib/bulldog/processor/argument_tree.rb +1 -1
- data/lib/bulldog/processor/ffmpeg.rb +2 -2
- data/lib/bulldog/processor/image_magick.rb +1 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
== 0.0.14 2010-01-19
|
2
|
+
|
3
|
+
* Optimizations.
|
4
|
+
|
5
|
+
== 0.0.13 2010-01-18
|
6
|
+
|
7
|
+
* Strip images if the :stripped style attribute is set.
|
8
|
+
|
9
|
+
== 0.0.12 2010-01-18
|
10
|
+
|
11
|
+
* Optimizations.
|
12
|
+
|
1
13
|
== 0.0.11 2009-12-03
|
2
14
|
|
3
15
|
* Make Attachment::Base#process! take options like #process.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.14
|
data/bulldog.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{bulldog}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.14"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["George Ogata"]
|
12
|
-
s.date = %q{2010-01-
|
12
|
+
s.date = %q{2010-01-19}
|
13
13
|
s.description = %q{= Bulldog
|
14
14
|
|
15
15
|
Flexible file attachments for active record.
|
@@ -19,7 +19,7 @@ module Bulldog
|
|
19
19
|
from_examination :original_dimensions
|
20
20
|
else
|
21
21
|
style = reflection.styles[style_name]
|
22
|
-
target_dimensions = style[:size].split(/x/).map
|
22
|
+
target_dimensions = style[:size].split(/x/).map{|s| s.to_i}
|
23
23
|
resized_dimensions(dimensions(:original), target_dimensions, style[:filled])
|
24
24
|
end
|
25
25
|
end
|
@@ -51,7 +51,7 @@ module Bulldog
|
|
51
51
|
else
|
52
52
|
output = `identify -format "%w %h %[exif:Orientation]" #{stream.path} 2> /dev/null`
|
53
53
|
if $?.success? && output.present?
|
54
|
-
width, height, orientation = *output.scan(/(\d+) (\d+) (\d?)/).first.map
|
54
|
+
width, height, orientation = *output.scan(/(\d+) (\d+) (\d?)/).first.map{|s| s.to_i}
|
55
55
|
rotated = (orientation & 0x4).nonzero?
|
56
56
|
@original_dimensions = rotated ? [height, width] : [width, height]
|
57
57
|
true
|
@@ -19,7 +19,7 @@ module Bulldog
|
|
19
19
|
from_examination :original_dimensions
|
20
20
|
else
|
21
21
|
style = reflection.styles[style_name]
|
22
|
-
target_dimensions = style[:size].split(/x/).map
|
22
|
+
target_dimensions = style[:size].split(/x/).map{|s| s.to_i}
|
23
23
|
resized_dimensions(dimensions(:original), target_dimensions, style[:filled])
|
24
24
|
end
|
25
25
|
end
|
@@ -46,7 +46,7 @@ module Bulldog
|
|
46
46
|
else
|
47
47
|
output = `identify -format "%w %h %[exif:Orientation]" #{stream.path}[0] 2> /dev/null`
|
48
48
|
if $?.success? && output.present?
|
49
|
-
width, height, orientation = *output.scan(/(\d+) (\d+) (\d?)/).first.map
|
49
|
+
width, height, orientation = *output.scan(/(\d+) (\d+) (\d?)/).first.map{|s| s.to_i}
|
50
50
|
rotated = (orientation & 0x4).nonzero?
|
51
51
|
@original_dimensions ||= rotated ? [height, width] : [width, height]
|
52
52
|
true
|
@@ -57,7 +57,7 @@ module Bulldog
|
|
57
57
|
end
|
58
58
|
else
|
59
59
|
style = reflection.styles[style_name]
|
60
|
-
target_dimensions = style[:size].split(/x/).map
|
60
|
+
target_dimensions = style[:size].split(/x/).map{|s| s.to_i}
|
61
61
|
video_tracks(:original).map do |video_track|
|
62
62
|
dimensions = resized_dimensions(dimensions(:original), target_dimensions, style[:filled])
|
63
63
|
dimensions.map!{|i| i &= -2} # some codecs require multiples of 2
|
@@ -58,7 +58,7 @@ module Bulldog
|
|
58
58
|
private # ---------------------------------------------------
|
59
59
|
|
60
60
|
def inspect_node(io, node, margin='')
|
61
|
-
puts "#{margin}* #{node.styles.map
|
61
|
+
puts "#{margin}* #{node.styles.map{|s| s.name}.join(', ')}: #{node.arguments.join(' ')}"
|
62
62
|
node.children.each do |child|
|
63
63
|
inspect_node(io, child, margin + ' ')
|
64
64
|
end
|
@@ -92,7 +92,7 @@ module Bulldog
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def operate(*args)
|
95
|
-
@arguments.concat args.map
|
95
|
+
@arguments.concat args.map{|s| s.to_s}
|
96
96
|
end
|
97
97
|
|
98
98
|
def set_default_operation
|
@@ -169,7 +169,7 @@ module Bulldog
|
|
169
169
|
end
|
170
170
|
|
171
171
|
def run_still_frame_callbacks
|
172
|
-
@still_frame_callbacks.each
|
172
|
+
@still_frame_callbacks.each{|c| c.call}
|
173
173
|
end
|
174
174
|
end
|
175
175
|
end
|
@@ -32,7 +32,7 @@ module Bulldog
|
|
32
32
|
def dimensions(&block)
|
33
33
|
operate '-format', '%w %h'
|
34
34
|
operate '-identify' do |styles, output|
|
35
|
-
width, height = output.gets.split.map
|
35
|
+
width, height = output.gets.split.map{|line| line.to_i}
|
36
36
|
block.call(styles, width, height)
|
37
37
|
end
|
38
38
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bulldog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George Ogata
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-19 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|