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 +4 -4
- data/dist/emoji/unicode/ballet_dancer/2.png +0 -0
- data/dist/emoji/unicode/ballet_dancer/3.png +0 -0
- data/dist/emoji/unicode/ballet_dancer/4.png +0 -0
- data/dist/emoji/unicode/ballet_dancer/5.png +0 -0
- data/dist/emoji/unicode/ballet_dancer/6.png +0 -0
- data/dist/emoji/unicode/fight_cloud.png +0 -0
- data/dist/emoji/unicode/hairy_creature.png +0 -0
- data/dist/emoji/unicode/landslide.png +0 -0
- data/dist/emoji/unicode/orca.png +0 -0
- data/dist/emoji/unicode/root_vegetable.png +0 -0
- data/dist/emoji/unicode/treasure_chest.png +0 -0
- data/dist/emoji/unicode/trombone.png +0 -0
- data/lib/discourse_emojis/unicode_emoji_processor.rb +15 -1
- data/lib/discourse_emojis/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d72eb2c5473ca0343d1deb63e2200cbddf7274fbc3fc7cfb01ce579d07d5b08e
|
4
|
+
data.tar.gz: a76ec183d73d271df4b1809c650ebe0de13543f09e3fc58382969c14a32d2284
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/dist/emoji/unicode/orca.png
CHANGED
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
|
-
|
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
|