oxen_media 0.0.2 → 0.0.3

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: 8884d3a2298175bfa7108a1c8507436a84457667
4
- data.tar.gz: 202a2d45076d37baed189cb3ecfe5bee30ec86e4
3
+ metadata.gz: 6c69de63f7847a197faea01c7d352f922815ebcd
4
+ data.tar.gz: c54b2e59ce73282b745f6b07640370bb683367c7
5
5
  SHA512:
6
- metadata.gz: a800debd118b021cc32ab7d5d2970ffa96e262787d243bbaedf3e7f9f0fee6f1063d7ac446efdd2ea3c0289fdea2b315200ea70994bc0b2c545389369cc1032d
7
- data.tar.gz: 0d198f4bb19808b74cd7256f3d2cf61fb5fca9cdc0b79646be6e616a120d4d3240cd224ee35cc63e084fe42df54b040964bd75d7dbf970f95f78bbf50055baf7
6
+ metadata.gz: e47a6caac9b15fa734d9f70ad156933d9fe5a7c8ba59b5f1050249446dcde86e473fd977c35cb8b0f2e8d7473a7c83094109e24ee1fa54ffdba88d3045890970
7
+ data.tar.gz: 5749a23c35f46abc93e317b6a3375dfccb35973a7106c1eb59622af3808893373bb1f283219506299d5bdff3eb4b33c683a8dbce1696165813d0a5589af1c531
@@ -67,6 +67,9 @@ class MediumUploader < CarrierWave::Uploader::Base
67
67
  end
68
68
 
69
69
 
70
+ resize_to_limit(1024, 768)
71
+
72
+
70
73
  # Process files as they are uploaded:
71
74
  # process :scale => [200, 300]
72
75
  #
@@ -74,17 +77,61 @@ class MediumUploader < CarrierWave::Uploader::Base
74
77
  # # do something
75
78
  # end
76
79
 
77
- # Create different versions of your uploaded files:
78
- # version :thumb do
79
- # process :resize_to_fit => [50, 50]
80
- # end
81
80
 
82
81
  # Add a white list of extensions which are allowed to be uploaded.
83
82
  # For images you might use something like this:
84
- # def extension_white_list
85
- # %w(jpg jpeg gif png pdf zip mp4 docx xlsx)
83
+ def extension_white_list
84
+ %w(jpg jpeg gif png)
85
+ end
86
+
87
+ # Override the filename of the uploaded files:
88
+ # Avoid using model.id or version_name here, see uploader/store.rb for details.
89
+ # def filename
90
+ # "something.jpg" if original_filename
86
91
  # end
87
92
 
93
+
94
+ version :large do
95
+ process :crop
96
+ end
97
+
98
+ version :preview do
99
+ process :crop
100
+ resize_to_limit(690, 518)
101
+ end
102
+
103
+ version :thumb do
104
+ process :crop
105
+ resize_to_fill(100, 100)
106
+ end
107
+
108
+
109
+ def crop
110
+ if model.crop_x.present?
111
+ manipulate! do |img|
112
+ x = model.crop_x.to_i
113
+ y = model.crop_y.to_i
114
+ w = model.crop_w.to_i
115
+ h = model.crop_h.to_i
116
+ img = img.crop(x, y, w, h)
117
+ img
118
+ end
119
+ end
120
+ end
121
+
122
+ def convert_to_grayscale
123
+ manipulate! do |img|
124
+ img.colorspace = Magick::GRAYColorspace
125
+ img
126
+ end
127
+ end
128
+
129
+ def brightness
130
+ manipulate! do |img|
131
+ img.modulate(1.20, 0.5, 1.2)
132
+ end
133
+ end
134
+
88
135
  # Override the filename of the uploaded files:
89
136
  # Avoid using model.id or version_name here, see uploader/store.rb for details.
90
137
  # def filename
@@ -1,3 +1,3 @@
1
1
  module OxenMedia
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxen_media
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Walther H Diechmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-27 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails