discourse-emojis 1.0.42 → 1.0.43

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
  SHA256:
3
- metadata.gz: 0a63dd230c479bb5ce0fa616245613983d9328c087006cbf9edeffedb744668b
4
- data.tar.gz: f4777c8dd6619dd900781998455307f03def55505a474de43aa24f0c39797273
3
+ metadata.gz: d72eb2c5473ca0343d1deb63e2200cbddf7274fbc3fc7cfb01ce579d07d5b08e
4
+ data.tar.gz: a76ec183d73d271df4b1809c650ebe0de13543f09e3fc58382969c14a32d2284
5
5
  SHA512:
6
- metadata.gz: 874b352c46d89b934c9da3841a407fe9c86bdde96957feb7c8d4e82a22075b2eacb397d22f4b1a7995e5217bdc0b229dbdf01907b76c03624e64d8ba81ca0324
7
- data.tar.gz: a9bcda281bff3f7bebe1b43a35e8089eea9a34f1c0ded788b6467ea58d0e66745bea9d8281139b1159219c216959d86f046d8ff2ec8d8e86003ac643194d858e
6
+ metadata.gz: 50ed7a4ed0479ef1d9db1d48c30e33b255a495954e3222144019b5fcbc00c2318accb26c65e457a88827af90f0de8cc82c7e0a8e165138e718ab0d50aa6de307
7
+ data.tar.gz: 96b79732ecc3c6848a28c7791492f6a26db22e612ec0ace624ae3717f72d79f7ea9ee3649272a52ad2f8deb8b5b8cd5c85b95579665b729f353f7789ce2397ce
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -171,7 +171,9 @@ module DiscourseEmojis
171
171
  end
172
172
 
173
173
  def save_base_emoji(emoji_name, image_data)
174
- File.open("#{UNICODE_EMOJI_DIR}/#{emoji_name}.png", "wb") { |f| f.write(image_data) }
174
+ output_path = "#{UNICODE_EMOJI_DIR}/#{emoji_name}.png"
175
+ File.open(output_path, "wb") { |f| f.write(image_data) }
176
+ resize_png(output_path)
175
177
  end
176
178
 
177
179
  def save_variations(emoji_name, codepoint, variations)
@@ -185,6 +187,18 @@ module DiscourseEmojis
185
187
  level = FITZPATRICK_SCALE[var[:modifier]]
186
188
  filename = "#{variation_dir}/#{level}.png"
187
189
  File.open(filename, "wb") { |f| f.write(var[:image]) }
190
+ resize_png(filename)
191
+ end
192
+ end
193
+
194
+ def resize_png(png_path)
195
+ dimensions = `magick identify -format "%wx%h" #{png_path}`.strip
196
+ return if dimensions == "72x72"
197
+
198
+ resize_cmd = ["magick", png_path, "-resize", "72x72>", png_path]
199
+ unless system(*resize_cmd)
200
+ puts "Error resizing image with ImageMagick."
201
+ exit 1
188
202
  end
189
203
  end
190
204
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DiscourseEmojis
4
- VERSION = "1.0.42"
4
+ VERSION = "1.0.43"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discourse-emojis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.42
4
+ version: 1.0.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joffrey Jaffeux