harmony-service 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/harmony/service/utils/image.rb +2 -2
- data/lib/harmony/service/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dd914b5f56ece32ed924258234b7658b2e234f7
|
4
|
+
data.tar.gz: d9918fab7ecceb3911f392b900fa8f5ab0b31efa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 478d87848d404c4ed15053f9e5c8fed47850aa58f597938a995ceb31f6a27c9529614bfff4270dcd73fb51dfa5f280d4b47c489182ecea263119b2199f7560e1
|
7
|
+
data.tar.gz: 39ee287ebd016abeab90f601ea8dd8f0ea31ed075f009059d012b9b2fea9b3b1d96f1eba086740ade04de87566207303e6d5a3ed503762d3616ca11dfe7c7263
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'mini_magick'
|
2
2
|
|
3
3
|
class Harmony::Service::Utils::Image
|
4
|
-
def resize(uri, max_file_size)
|
4
|
+
def resize(uri, max_file_size, format: 'jpeg')
|
5
5
|
output_filepath = "/tmp/output.#{DateTime.now.strftime('%Q')}.png"
|
6
6
|
image = MiniMagick::Image.open(uri)
|
7
7
|
image.define "extent=#{max_file_size}"
|
8
|
-
image.format
|
8
|
+
image.format format
|
9
9
|
image.write output_filepath
|
10
10
|
File.new(output_filepath)
|
11
11
|
end
|