insano_image_resizer 0.4.0 → 0.4.1
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.
- data/lib/insano_image_resizer/processor.rb +5 -2
- metadata +1 -1
@@ -134,8 +134,11 @@ module InsanoImageResizer
|
|
134
134
|
# since the region is still centered around the POI, we can just trim equally on either the W or H as necessary.
|
135
135
|
transform[:x] -= (viewport_size[:w] - transform[:w]) / 2
|
136
136
|
transform[:y] -= (viewport_size[:h] - transform[:h]) / 2
|
137
|
-
transform[:w] = viewport_size[:w]
|
138
|
-
transform[:h] = viewport_size[:h]
|
137
|
+
transform[:w] = viewport_size[:w]
|
138
|
+
transform[:h] = viewport_size[:h]
|
139
|
+
|
140
|
+
transform[:x] = transform[:x].round
|
141
|
+
transform[:y] = transform[:y].round
|
139
142
|
|
140
143
|
# alright—now our transform most likely extends beyond the bounds of the image
|
141
144
|
# data. Let's add some constraints that push it within the bounds of the image.
|