blobsterix 0.0.31 → 0.0.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.txt +6 -1
- data/lib/blobsterix/transformation/image_transformation.rb +16 -5
- data/lib/blobsterix/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84d8040f056cf1de1de49568af0cccf424a6c990
|
4
|
+
data.tar.gz: 436842aa680d447ca3e6307f2ae984f6b0931aed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a0baf3c7a14c6f7d7b9b3fec9e4aa00a9b88a3dae2f14c14a689bdee0a814120d29c07ed43e7fd639d96cdfa86096df067afeea3daa70a32a61639563519dd1
|
7
|
+
data.tar.gz: 56f9c9ed4ff63b50cfa31cc6e31b4e3aae15b6a1ae005eadaf0b2040fb61ce8bb78b071555805ed56089322794a125f441b2cadd55b1fcd48b701b41fea7972e
|
data/CHANGELOG.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
= 0.0.32
|
2
|
+
* added new transformation: croppercent allows a picture to be cropped via
|
3
|
+
percentage. 100%=1000, 1%=10, 0.5%=5
|
4
|
+
500x500+100+100
|
5
|
+
width: 50%, height: 50%, x: 10%, y: 10%
|
6
|
+
wrong values will fail the transformation
|
1
7
|
= 0.0.31
|
2
8
|
* changed the cache invalidation call to use a meta_data object as well as blobaccess
|
3
9
|
* brakes current cache_checker implementations!
|
@@ -59,4 +65,3 @@
|
|
59
65
|
* adding maxsize
|
60
66
|
= 0.0.4
|
61
67
|
* The first rc
|
62
|
-
|
@@ -9,7 +9,7 @@ module Blobsterix::Transformations::Impl
|
|
9
9
|
def self.name_
|
10
10
|
@name
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def self.is_format=(obj)
|
14
14
|
@is_format=obj
|
15
15
|
end
|
@@ -17,16 +17,16 @@ module Blobsterix::Transformations::Impl
|
|
17
17
|
def self.is_format_
|
18
18
|
@is_format
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def self.setTypes(input,output)
|
22
22
|
@input= ::Blobsterix::AcceptType.new input
|
23
23
|
@output= ::Blobsterix::AcceptType.new output
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def self.input_type_
|
27
27
|
@input
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def self.output_type_
|
31
31
|
@output
|
32
32
|
end
|
@@ -121,6 +121,17 @@ module Blobsterix::Transformations::Impl
|
|
121
121
|
image.write target_path
|
122
122
|
end
|
123
123
|
|
124
|
+
create_simple_trafo("croppercent", "image/*", "image/*", false) do |input_path, target_path, value|
|
125
|
+
values = /(\d+)x(\d+)\+(\d+)\+(\d+)/.match(value)
|
126
|
+
raise StandardError.new("The provided cropping values are wrong") unless values
|
127
|
+
width,height,x,y = values[1..-1].map{|i| i.to_i}
|
128
|
+
raise StandardError.new("Values are to big") if width+x>1000 || height+y>1000
|
129
|
+
|
130
|
+
image = MiniMagick::Image.open(input_path)
|
131
|
+
image.crop "#{width/1000.0*image[:width]}x#{height/1000.0*image[:height]}+#{x/1000.0*image[:width]}+#{y/1000.0*image[:height]}"
|
132
|
+
image.write target_path
|
133
|
+
end
|
134
|
+
|
124
135
|
# create_simple_trafo("image2HTML", "image/*", "text/html", true) do |input_path, target_path, value|
|
125
136
|
# type = "image/*"
|
126
137
|
# File.open(input_path) {|file|
|
@@ -228,4 +239,4 @@ module Blobsterix::Transformations::Impl
|
|
228
239
|
out.write(file.as_json.to_json)
|
229
240
|
end
|
230
241
|
end
|
231
|
-
end
|
242
|
+
end
|
data/lib/blobsterix/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blobsterix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Sudmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|