diff --git a/lib/tasks/emoji.rake b/lib/tasks/emoji.rake index 14190b74eb7..6ea15b77f34 100644 --- a/lib/tasks/emoji.rake +++ b/lib/tasks/emoji.rake @@ -40,7 +40,10 @@ task "emoji:update" => :environment do code = cells[1].at_css("a")["name"] - next unless emojis[code] + unless emojis[code] + code = code.gsub(/_fe0f/, "") + next unless emojis[code] + end apple = cell_to_image(cells[4]) google = cell_to_image(cells[5]) @@ -50,7 +53,7 @@ task "emoji:update" => :environment do if WINDOWS_FLAGS.include?(code) windows = custom_windows_flag(code) else - windows = cell_to_image(cells[9]) + windows = cell_to_image(cells[11]) end if apple.blank? || google.blank? || twitter.blank? || one.blank? || windows.blank? @@ -94,13 +97,16 @@ def custom_windows_flag(code) end def write_emojis(emojis, aliases, style, folder) - path = "public/images/emoji/#{folder}/" + path = "public/images/emoji/#{folder}" - FileUtils.rm_f Dir.glob("#{path}/*") + # Uncomment to recreate all emojis + # FileUtils.rm_f Dir.glob("#{path}/*") puts folder emojis.values.each do |emoji| + next if emoji[style].nil? + write_emoji("#{path}/#{emoji[:name]}.png", emoji[style]) if aliases[emoji[:name]] aliases[emoji[:name]].each do |new_name| @@ -113,7 +119,9 @@ def write_emojis(emojis, aliases, style, folder) end def write_emoji(path, emoji) - open(path, "wb") { |f| f << emoji } - `pngout #{path}` - putc "." + open(path, "wb") { |f| f << emoji } + `pngout #{path}` + putc "." +ensure + raise "Failed to write emoji: #{path}" if File.exists?(path) && !File.size?(path) end diff --git a/public/images/emoji/apple/hash.png b/public/images/emoji/apple/hash.png index e69de29bb2d..64f9f559649 100644 Binary files a/public/images/emoji/apple/hash.png and b/public/images/emoji/apple/hash.png differ diff --git a/public/images/emoji/apple/keycap_star.png b/public/images/emoji/apple/keycap_star.png index e69de29bb2d..f847acf58c4 100644 Binary files a/public/images/emoji/apple/keycap_star.png and b/public/images/emoji/apple/keycap_star.png differ diff --git a/public/images/emoji/apple/zero.png b/public/images/emoji/apple/zero.png index e69de29bb2d..4b2b38dce0a 100644 Binary files a/public/images/emoji/apple/zero.png and b/public/images/emoji/apple/zero.png differ diff --git a/public/images/emoji/emoji_one/hash.png b/public/images/emoji/emoji_one/hash.png index e69de29bb2d..1efc8cc6e35 100644 Binary files a/public/images/emoji/emoji_one/hash.png and b/public/images/emoji/emoji_one/hash.png differ diff --git a/public/images/emoji/emoji_one/keycap_star.png b/public/images/emoji/emoji_one/keycap_star.png index e69de29bb2d..8ed4edab8fc 100644 Binary files a/public/images/emoji/emoji_one/keycap_star.png and b/public/images/emoji/emoji_one/keycap_star.png differ diff --git a/public/images/emoji/emoji_one/zero.png b/public/images/emoji/emoji_one/zero.png index e69de29bb2d..8123d5e090e 100644 Binary files a/public/images/emoji/emoji_one/zero.png and b/public/images/emoji/emoji_one/zero.png differ diff --git a/public/images/emoji/google/hash.png b/public/images/emoji/google/hash.png index e69de29bb2d..706a31c13b1 100644 Binary files a/public/images/emoji/google/hash.png and b/public/images/emoji/google/hash.png differ diff --git a/public/images/emoji/google/keycap_star.png b/public/images/emoji/google/keycap_star.png index e69de29bb2d..bc41c667b2c 100644 Binary files a/public/images/emoji/google/keycap_star.png and b/public/images/emoji/google/keycap_star.png differ diff --git a/public/images/emoji/google/zero.png b/public/images/emoji/google/zero.png index e69de29bb2d..ce02394db08 100644 Binary files a/public/images/emoji/google/zero.png and b/public/images/emoji/google/zero.png differ diff --git a/public/images/emoji/twitter/hash.png b/public/images/emoji/twitter/hash.png index e69de29bb2d..5309b3d0c97 100644 Binary files a/public/images/emoji/twitter/hash.png and b/public/images/emoji/twitter/hash.png differ diff --git a/public/images/emoji/twitter/keycap_star.png b/public/images/emoji/twitter/keycap_star.png index e69de29bb2d..2bfefce2bec 100644 Binary files a/public/images/emoji/twitter/keycap_star.png and b/public/images/emoji/twitter/keycap_star.png differ diff --git a/public/images/emoji/twitter/zero.png b/public/images/emoji/twitter/zero.png index e69de29bb2d..f4244918d5b 100644 Binary files a/public/images/emoji/twitter/zero.png and b/public/images/emoji/twitter/zero.png differ diff --git a/public/images/emoji/win10/eight.png b/public/images/emoji/win10/eight.png index 941ddf7da0d..4fe4c5f23e2 100644 Binary files a/public/images/emoji/win10/eight.png and b/public/images/emoji/win10/eight.png differ diff --git a/public/images/emoji/win10/five.png b/public/images/emoji/win10/five.png index f8b21706daf..1e284bf610a 100644 Binary files a/public/images/emoji/win10/five.png and b/public/images/emoji/win10/five.png differ diff --git a/public/images/emoji/win10/four.png b/public/images/emoji/win10/four.png index 3a22419dc59..a5d7e4f82e7 100644 Binary files a/public/images/emoji/win10/four.png and b/public/images/emoji/win10/four.png differ diff --git a/public/images/emoji/win10/hash.png b/public/images/emoji/win10/hash.png index e69de29bb2d..7d06801e1f5 100644 Binary files a/public/images/emoji/win10/hash.png and b/public/images/emoji/win10/hash.png differ diff --git a/public/images/emoji/win10/nine.png b/public/images/emoji/win10/nine.png index 655f80a7f9e..290dc7fe930 100644 Binary files a/public/images/emoji/win10/nine.png and b/public/images/emoji/win10/nine.png differ diff --git a/public/images/emoji/win10/one.png b/public/images/emoji/win10/one.png index eba530a82c8..95e3c094c86 100644 Binary files a/public/images/emoji/win10/one.png and b/public/images/emoji/win10/one.png differ diff --git a/public/images/emoji/win10/seven.png b/public/images/emoji/win10/seven.png index c1329dd7734..1c839c4e10d 100644 Binary files a/public/images/emoji/win10/seven.png and b/public/images/emoji/win10/seven.png differ diff --git a/public/images/emoji/win10/six.png b/public/images/emoji/win10/six.png index 8e4b23b3ba0..8e8a805e87d 100644 Binary files a/public/images/emoji/win10/six.png and b/public/images/emoji/win10/six.png differ diff --git a/public/images/emoji/win10/three.png b/public/images/emoji/win10/three.png index bf930925c43..9cb4d40b0f3 100644 Binary files a/public/images/emoji/win10/three.png and b/public/images/emoji/win10/three.png differ diff --git a/public/images/emoji/win10/two.png b/public/images/emoji/win10/two.png index 5a7e4819477..da3eb230b73 100644 Binary files a/public/images/emoji/win10/two.png and b/public/images/emoji/win10/two.png differ diff --git a/public/images/emoji/win10/zero.png b/public/images/emoji/win10/zero.png index e69de29bb2d..e5b08a12679 100644 Binary files a/public/images/emoji/win10/zero.png and b/public/images/emoji/win10/zero.png differ