westarete-skylinecms 3.0.8.20100329 → 3.0.8.20100330
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/app/models/skyline/media_file.rb +25 -11
- data/config/initializers/dependencies.rb +1 -1
- metadata +7 -7
data/Rakefile
CHANGED
@@ -67,7 +67,7 @@ namespace :gem do
|
|
67
67
|
gemspec.description = "Skyline is an extremely flexible and expandable open source content management system. Its feature rich interface allows for fast and intuitive management of websites."
|
68
68
|
gemspec.email = "info@digitpaint.nl"
|
69
69
|
gemspec.homepage = "http://www.skylinecms.nl"
|
70
|
-
gemspec.authors = ["DigitPaint", "
|
70
|
+
gemspec.authors = ["DigitPaint", "WestAreteComputing"]
|
71
71
|
|
72
72
|
gemspec.files.exclude "tasks/testing.rake"
|
73
73
|
gemspec.files.exclude "Gemfile"
|
@@ -87,7 +87,7 @@ namespace :gem do
|
|
87
87
|
gemspec.add_dependency "polyglot", "0.3.0"
|
88
88
|
gemspec.add_dependency "sprockets", "1.0.2"
|
89
89
|
gemspec.add_dependency "mime-types", "1.16"
|
90
|
-
gemspec.add_dependency "
|
90
|
+
gemspec.add_dependency "image_science", "1.2.1"
|
91
91
|
gemspec.add_dependency "hpricot", "0.8.2"
|
92
92
|
gemspec.add_dependency "guid", "0.1.1"
|
93
93
|
gemspec.add_dependency "will_paginate", "~>2.3.11"
|
@@ -26,12 +26,17 @@ class Skyline::MediaFile < Skyline::MediaNode
|
|
26
26
|
# ==== Returns
|
27
27
|
# <ImageBlob>:: blob of the Magick::Image
|
28
28
|
def thumbnail(width=100,height=100)
|
29
|
-
img = Magick::Image::read(self.file_path).first
|
30
|
-
|
31
|
-
width,height = self.proportional_dimension(width,height,img.columns,img.rows)
|
32
|
-
|
33
|
-
stream = img.change_geometry!("#{width}x#{height}"){ |c,r,i| i.resize!(c,r) }
|
34
|
-
stream.to_blob
|
29
|
+
# img = Magick::Image::read(self.file_path).first
|
30
|
+
#
|
31
|
+
# width,height = self.proportional_dimension(width,height,img.columns,img.rows)
|
32
|
+
#
|
33
|
+
# stream = img.change_geometry!("#{width}x#{height}"){ |c,r,i| i.resize!(c,r) }
|
34
|
+
# stream.to_blob
|
35
|
+
ImageScience.with_image(self.file_path) do |img|
|
36
|
+
img.resize(width, height) do |thumb|
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
35
40
|
end
|
36
41
|
|
37
42
|
# returns the dimension of the original image
|
@@ -125,14 +130,23 @@ class Skyline::MediaFile < Skyline::MediaNode
|
|
125
130
|
begin
|
126
131
|
img = case self.data
|
127
132
|
when ActionController::UploadedTempfile,Tempfile
|
128
|
-
Magick::Image::read(self.data.path).first
|
133
|
+
# Magick::Image::read(self.data.path).first
|
134
|
+
ImageScience.with_image(self.data.path) do |img|
|
135
|
+
self.width = img.width
|
136
|
+
self.height = img.height
|
137
|
+
end
|
129
138
|
else
|
130
|
-
Magick::Image::from_blob(self.data.read).first
|
131
|
-
self.data.rewind
|
139
|
+
# Magick::Image::from_blob(self.data.read).first
|
140
|
+
# self.data.rewind
|
141
|
+
|
142
|
+
ImageScience.with_image_from_memory(self.data.read) do |img|
|
143
|
+
self.width = img.width
|
144
|
+
self.height = img.height
|
145
|
+
end
|
132
146
|
end
|
133
147
|
|
134
|
-
self.width = img.columns
|
135
|
-
self.height = img.rows
|
148
|
+
# self.width = img.columns
|
149
|
+
# self.height = img.rows
|
136
150
|
rescue
|
137
151
|
end
|
138
152
|
end
|
metadata
CHANGED
@@ -6,12 +6,12 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 3
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 3.0.8.
|
9
|
+
- 20100330
|
10
|
+
version: 3.0.8.20100330
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- DigitPaint
|
14
|
-
-
|
14
|
+
- WestAreteComputing
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
@@ -103,7 +103,7 @@ dependencies:
|
|
103
103
|
type: :runtime
|
104
104
|
version_requirements: *id006
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
|
-
name:
|
106
|
+
name: image_science
|
107
107
|
prerelease: false
|
108
108
|
requirement: &id007 !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
@@ -111,9 +111,9 @@ dependencies:
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
segments:
|
113
113
|
- 1
|
114
|
-
-
|
115
|
-
-
|
116
|
-
version: 1.
|
114
|
+
- 2
|
115
|
+
- 1
|
116
|
+
version: 1.2.1
|
117
117
|
type: :runtime
|
118
118
|
version_requirements: *id007
|
119
119
|
- !ruby/object:Gem::Dependency
|