imagetools 1.1.0 → 1.2.0

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
  SHA256:
3
- metadata.gz: 4321ff7a51cd2038d5acb37c21c932d40ce0eb0e7a0f2514e852dd7c36e26617
4
- data.tar.gz: dc47c8f323837468154686fed41727a9096560bed0ca0cb00e1f62b675ba44f6
3
+ metadata.gz: 76f5fa221bbd274c1ef8b9c54195abec9b2081b210355cf345ea7ea1dc047a35
4
+ data.tar.gz: 4b59da67822eb56fbb35af75f9bf2fec12662147988b7a5f788231f8108ba305
5
5
  SHA512:
6
- metadata.gz: e8383d80757e294e21277deade67ee1b05b1760918b3b2ef6b76478959244a6b1b39e682630b68b876f87371121df9cc4dc8a6a0db5954bda84ab61346b8101a
7
- data.tar.gz: 0a69d98a867405f44dccf7406cc1cd9a9a1e82b2eb2bf5eb979e284ea89aa28878118a75df83ff6e8c36e44b559b6d795fa00aab7ff1198655e1549f65a36da2
6
+ metadata.gz: 12bfae8ed2f2b75d6d79180c15d50034a996d9c9492d0e4f495a0de615af2a76456e7bb0f5c073c3528aeb559f31777c4bce5c647ccd4a93964a4b69690b42b8
7
+ data.tar.gz: ff5ef80f32291a7d9197e87ad000950e9136015e621735254d2d539c797e3f1c9b8680301610258388d473222a54110c8b68552ad8fb5a60d18f866806df124a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- imagetools (1.1.0)
4
+ imagetools (1.2.0)
5
5
  rmagick (= 3.2.0)
6
6
 
7
7
  GEM
@@ -49,13 +49,14 @@ module Imagetools
49
49
 
50
50
  CONVERT_CMD = "convert"
51
51
  DWEBP_CMD = "dwebp"
52
- RESIZE_CMD = "mogrify -resize 1280x\\> "
52
+ # RESIZE_CMD = "mogrify -resize 1280x\\> "
53
+ RESIZE_CMD = "mogrify -background white -resize 1280x\\> "
53
54
  ROTATE_CMD = "exiftran -ai "
54
55
  COMPRESS_CMD = "jpegoptim --strip-all --max=90 "
55
56
  EXTERNAL_CMDS = [RESIZE_CMD, ROTATE_CMD, COMPRESS_CMD]
56
57
 
57
58
  WEBP_SEARCH = /(.+)\.webp/i
58
- WEBP_REPLACE = '\1.jpg'
59
+ WEBP_REPLACE = '\1.png'
59
60
 
60
61
  PNG_SEARCH = /(.+)\.png/i
61
62
  PNG_REPLACE = '\1.jpg'
@@ -133,7 +134,7 @@ EOM
133
134
  filename.sub(OTHER_JPG_SEARCH, OTHER_JPG_REPLACE)
134
135
  end
135
136
 
136
- def self.replace_webp2jpg(filename)
137
+ def self.replace_webp2png(filename)
137
138
  filename.sub(WEBP_SEARCH, WEBP_REPLACE)
138
139
  end
139
140
 
@@ -173,7 +174,7 @@ EOM
173
174
  end
174
175
 
175
176
  filepath = rename_image(filepath)
176
- filepath = webp2jpg(filepath)
177
+ filepath = webp2png(filepath)
177
178
  filepath = png2jpg(filepath)
178
179
  filepath = resize_jpg(filepath)
179
180
  filepath = rotate_jpg(filepath)
@@ -203,9 +204,9 @@ EOM
203
204
  return topath
204
205
  end
205
206
 
206
- def webp2jpg(filepath)
207
+ def webp2png(filepath)
207
208
  fromname = File.basename(filepath)
208
- toname = self.class.replace_webp2jpg(fromname)
209
+ toname = self.class.replace_webp2png(fromname)
209
210
  return filepath if fromname == toname
210
211
 
211
212
  dir = File.dirname(filepath)
@@ -1,3 +1,3 @@
1
1
  module Imagetools
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imagetools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - src
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-10 00:00:00.000000000 Z
11
+ date: 2020-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick