carrierwave-crop-on-fly 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 +4 -4
- data/README.md +10 -5
- data/lib/carrierwave/crop/extension_crop_data.rb +4 -4
- data/lib/carrierwave/crop/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: 9cffee5c482ce6e6def457c4e9902ec0241b3345
|
4
|
+
data.tar.gz: bea44c74f578ab4342e59e7141b54f409b9993fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53101d90297b31747da89f2aae820c2a8d712ece725a5f004a9c9f21534e904e7505534049a58a463915cdaa70e848e532e6bb034deb455651a9826a7973230a
|
7
|
+
data.tar.gz: 340de4fcbbd26e0a82b68d1dd26213fd531d5a641904671e0c336ce86ac891e4ec3e35280975b558b4fc37635acec4a6ec9bcfb940a6742d6dab1244666c59e8
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# CarrierWave-Fly
|
1
|
+
# CarrierWave-Crop-On-Fly
|
2
2
|
|
3
3
|
CarrierWave extension for on fly specifying crop area with preview and cropping images before they saved.
|
4
4
|
|
@@ -8,11 +8,11 @@ this gem based on [carrierwave-crop](https://github.com/kirtithorat/carrierwave-
|
|
8
8
|
|
9
9
|
Install the latest stable release:
|
10
10
|
|
11
|
-
$[sudo] gem install carrierwave-fly
|
11
|
+
$[sudo] gem install carrierwave-crop-on-fly
|
12
12
|
|
13
13
|
In Rails, add it to your Gemfile:
|
14
14
|
|
15
|
-
gem 'carrierwave-fly
|
15
|
+
gem 'carrierwave-crop-on-fly'
|
16
16
|
|
17
17
|
Also you must add mini_magick gem
|
18
18
|
|
@@ -31,7 +31,12 @@ Add the required files in assets
|
|
31
31
|
In .js file
|
32
32
|
|
33
33
|
//= require jquery
|
34
|
-
//= require
|
34
|
+
//= require jcrop.js
|
35
|
+
//= require_self
|
36
|
+
|
37
|
+
$(document).ready(function() {
|
38
|
+
document.jcrop.init({ file_input_id: 'user_avatar' });
|
39
|
+
});
|
35
40
|
|
36
41
|
In .css file
|
37
42
|
|
@@ -64,4 +69,4 @@ In the view:
|
|
64
69
|
|
65
70
|
### Credits and resources
|
66
71
|
* [CarrierWave](https://github.com/carrierwaveuploader/carrierwave)
|
67
|
-
* [Deep Liquid's JCrop](http://deepliquid.com/content/Jcrop.html)
|
72
|
+
* [Deep Liquid's JCrop](http://deepliquid.com/content/Jcrop.html)
|
@@ -12,10 +12,10 @@ module CarrierWave
|
|
12
12
|
private
|
13
13
|
|
14
14
|
def remember_crop_data(file)
|
15
|
-
self.crop_x = file.file.crop_x
|
16
|
-
self.crop_y = file.file.crop_y
|
17
|
-
self.crop_w = file.file.crop_w
|
18
|
-
self.crop_h = file.file.crop_h
|
15
|
+
self.crop_x = file.file.crop_x if file.file.respond_to?(:crop_x)
|
16
|
+
self.crop_y = file.file.crop_y if file.file.respond_to?(:crop_y)
|
17
|
+
self.crop_w = file.file.crop_w if file.file.respond_to?(:crop_w)
|
18
|
+
self.crop_h = file.file.crop_h if file.file.respond_to?(:crop_h)
|
19
19
|
end
|
20
20
|
|
21
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-crop-on-fly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- evg2108
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|