dynamic_image 2.0.0.beta7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 219e2cd03da1fd621bb8833c09d37b89c5be407d
4
- data.tar.gz: 6db549c4d2c8b45c830b420dd1e41ea7527bd463
3
+ metadata.gz: 6084a12d08ad9d94c391c15c4db5a1c18dd9f695
4
+ data.tar.gz: f2cb5d614baf98760086414f3a33585bd446a307
5
5
  SHA512:
6
- metadata.gz: 32e6c2c1c381e76d0e84dc0b7e0e31e9b16eee0b8bae54dc32ac1e708b5d6b505614e8a3e615cfb3f8fce81bb1154ad30ea8d86a2a841bd115dd9198081dbfc9
7
- data.tar.gz: 695bd3223cd10c4c0a0451132fc98b71390126d1c0926eccc5eb8dad00829af032a15ee3076263e19b8ac4297354d1bf9c04fa9770c03c163c1fefa5241bbba6
6
+ metadata.gz: 11ab636236b5ea3170b19d1649620a144f46f9bcc7c336576146c11454ab81844d4f2bf553a294c61850317d047266f1684fb767452a0572f61871b3f2aa5bcc
7
+ data.tar.gz: 5a3cf53be701fc82b0eec68920968f7b10446fdbec8b513191955198e4eca010da89ee61c8615967d16b2973c0adbe00448cc3fbe0ca4e4ee7d7b69bd1cca168
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # DynamicImage [![Build Status](https://travis-ci.org/elektronaut/dynamic_image.png)](https://travis-ci.org/elektronaut/dynamic_image) [![Code Climate](https://codeclimate.com/github/elektronaut/dynamic_image.png)](https://codeclimate.com/github/elektronaut/dynamic_image) [![Code Climate](https://codeclimate.com/github/elektronaut/dynamic_image/coverage.png)](https://codeclimate.com/github/elektronaut/dynamic_image)
1
+ # DynamicImage [![Build Status](https://travis-ci.org/elektronaut/dynamic_image.svg?branch=master)](https://travis-ci.org/elektronaut/dynamic_image) [![Code Climate](https://codeclimate.com/github/elektronaut/dynamic_image/badges/gpa.svg)](https://codeclimate.com/github/elektronaut/dynamic_image) [![Code Climate](https://codeclimate.com/github/elektronaut/dynamic_image/badges/coverage.svg)](https://codeclimate.com/github/elektronaut/dynamic_image) [![Dependency Status](https://gemnasium.com/elektronaut/dynamic_image.svg)](https://gemnasium.com/elektronaut/dynamic_image)
2
2
 
3
3
  Need to handle image uploads in your Rails app?
4
4
  Give DynamicImage a try.
@@ -34,7 +34,7 @@ and enumeration attacks.
34
34
  Add the gem to your Gemfile and run `bundle install`.
35
35
 
36
36
  ```ruby
37
- gem "dynamic_image"
37
+ gem "dynamic_image", "~> 2.0.0"
38
38
  ```
39
39
 
40
40
  Run the `dis:install` generator to set up your storage.
@@ -92,19 +92,19 @@ To resize it, specify a max size. This will scale the image down to fit, but
92
92
  no cropping will occur.
93
93
 
94
94
  ```erb
95
- <%= dynamic_image_tag(image, size: '400x400') %>
95
+ <%= dynamic_image_tag(image, size: "400x400") %>
96
96
  ```
97
97
 
98
98
  Setting `crop: true` will crop the image to the exact size.
99
99
 
100
100
  ```erb
101
- <%= dynamic_image_tag(image, size: '400x400', crop: true) %>
101
+ <%= dynamic_image_tag(image, size: "400x400", crop: true) %>
102
102
  ```
103
103
 
104
104
  Omitting either dimension will render the image at an exact width or height.
105
105
 
106
106
  ```erb
107
- <%= dynamic_image_tag(image, size: '400x') %>
107
+ <%= dynamic_image_tag(image, size: "400x") %>
108
108
  ```
109
109
 
110
110
  `dynamic_image_path` and `dynamic_image_url` act pretty much like regular URL
@@ -132,7 +132,7 @@ timestamped, and will change if the object changes.
132
132
 
133
133
  ## License
134
134
 
135
- Copyright 2006-2014 Inge Jørgensen
135
+ Copyright 2006-2016 Inge Jørgensen
136
136
 
137
137
  DynamicImage is released under the
138
138
  [MIT License](http://www.opensource.org/licenses/MIT).
@@ -36,8 +36,10 @@ module DynamicImage
36
36
  # Returns a binary string.
37
37
  def cropped_and_resized(size)
38
38
  normalized do |image|
39
- image.crop image_sizing.crop_geometry_string(size)
40
- image.resize size
39
+ if record.cropped? || size != record.size
40
+ image.crop(image_sizing.crop_geometry_string(size))
41
+ image.resize(size)
42
+ end
41
43
  end
42
44
  end
43
45
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module DynamicImage
4
- VERSION = "2.0.0.beta7"
4
+ VERSION = "2.0.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_image
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta7
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Inge Jørgensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-13 00:00:00.000000000 Z
11
+ date: 2016-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,34 +30,34 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.0'
33
+ version: '2.2'
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 2.0.2
36
+ version: 2.2.1
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: '2.0'
43
+ version: '2.2'
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 2.0.2
46
+ version: 2.2.1
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: mini_magick
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 3.8.1
53
+ version: 4.5.1
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 3.8.1
60
+ version: 4.5.1
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: dis
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -92,14 +92,14 @@ dependencies:
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: 3.0.0
95
+ version: 3.4.0
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: 3.0.0
102
+ version: 3.4.0
103
103
  description: DynamicImage is a Rails plugin that simplifies image uploading and processing
104
104
  email:
105
105
  - inge@elektronaut.no
@@ -142,12 +142,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
142
  version: 1.9.2
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ">"
145
+ - - ">="
146
146
  - !ruby/object:Gem::Version
147
- version: 1.3.1
147
+ version: '0'
148
148
  requirements: []
149
149
  rubyforge_project:
150
- rubygems_version: 2.4.1
150
+ rubygems_version: 2.4.5
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: Rails plugin that simplifies image uploading and processing