FIX: images:compress rake task

approved

#1

FIX: images:compress rake task

Optimized a few unoptimized PNGs.

diff --git a/app/assets/images/favicons/google_branding/logo_calendar_128px.png b/app/assets/images/favicons/google_branding/logo_calendar_128px.png
index 0adf29c..cde34ef 100644
Binary files a/app/assets/images/favicons/google_branding/logo_calendar_128px.png and b/app/assets/images/favicons/google_branding/logo_calendar_128px.png differ
diff --git a/app/assets/images/favicons/google_branding/logo_calendar_48px.png b/app/assets/images/favicons/google_branding/logo_calendar_48px.png
index bb50bb9..6ede0bb 100644
Binary files a/app/assets/images/favicons/google_branding/logo_calendar_48px.png and b/app/assets/images/favicons/google_branding/logo_calendar_48px.png differ
diff --git a/app/assets/images/favicons/google_branding/logo_docs_48px.png b/app/assets/images/favicons/google_branding/logo_docs_48px.png
index f1fe798..c67a2ed 100644
Binary files a/app/assets/images/favicons/google_branding/logo_docs_48px.png and b/app/assets/images/favicons/google_branding/logo_docs_48px.png differ
diff --git a/app/assets/images/favicons/google_branding/logo_drive_48px.png b/app/assets/images/favicons/google_branding/logo_drive_48px.png
index ff595ca..4f9cf38 100644
Binary files a/app/assets/images/favicons/google_branding/logo_drive_48px.png and b/app/assets/images/favicons/google_branding/logo_drive_48px.png differ
diff --git a/app/assets/images/favicons/google_branding/logo_forms_48px.png b/app/assets/images/favicons/google_branding/logo_forms_48px.png
index 4ba7be2..660a89c 100644
Binary files a/app/assets/images/favicons/google_branding/logo_forms_48px.png and b/app/assets/images/favicons/google_branding/logo_forms_48px.png differ
diff --git a/app/assets/images/favicons/google_branding/logo_sheets_48px.png b/app/assets/images/favicons/google_branding/logo_sheets_48px.png
index 0a3cdc3..e349d37 100644
Binary files a/app/assets/images/favicons/google_branding/logo_sheets_48px.png and b/app/assets/images/favicons/google_branding/logo_sheets_48px.png differ
diff --git a/app/assets/images/favicons/google_branding/logo_slides_48px.png b/app/assets/images/favicons/google_branding/logo_slides_48px.png
index 66b5155..1dcb602 100644
Binary files a/app/assets/images/favicons/google_branding/logo_slides_48px.png and b/app/assets/images/favicons/google_branding/logo_slides_48px.png differ
diff --git a/app/assets/images/favicons/pdf_48px.png b/app/assets/images/favicons/pdf_48px.png
index ce99d6e..4e13300 100644
Binary files a/app/assets/images/favicons/pdf_48px.png and b/app/assets/images/favicons/pdf_48px.png differ
diff --git a/app/assets/images/favicons/pdf_64px.png b/app/assets/images/favicons/pdf_64px.png
index 3c468bd..ce59d5c 100644
Binary files a/app/assets/images/favicons/pdf_64px.png and b/app/assets/images/favicons/pdf_64px.png differ
diff --git a/app/assets/images/push-notifications/check.png b/app/assets/images/push-notifications/check.png
index b613330..5415afb 100644
Binary files a/app/assets/images/push-notifications/check.png and b/app/assets/images/push-notifications/check.png differ
diff --git a/app/assets/images/push-notifications/discourse.png b/app/assets/images/push-notifications/discourse.png
index 46d9720..0727e39 100644
Binary files a/app/assets/images/push-notifications/discourse.png and b/app/assets/images/push-notifications/discourse.png differ
diff --git a/app/assets/images/push-notifications/group_mentioned.png b/app/assets/images/push-notifications/group_mentioned.png
index c3edbcc..35b0fcc 100644
Binary files a/app/assets/images/push-notifications/group_mentioned.png and b/app/assets/images/push-notifications/group_mentioned.png differ
diff --git a/app/assets/images/push-notifications/linked.png b/app/assets/images/push-notifications/linked.png
index f4770f1..6507ce9 100644
Binary files a/app/assets/images/push-notifications/linked.png and b/app/assets/images/push-notifications/linked.png differ
diff --git a/app/assets/images/push-notifications/mentioned.png b/app/assets/images/push-notifications/mentioned.png
index c3edbcc..35b0fcc 100644
Binary files a/app/assets/images/push-notifications/mentioned.png and b/app/assets/images/push-notifications/mentioned.png differ
diff --git a/app/assets/images/push-notifications/posted.png b/app/assets/images/push-notifications/posted.png
index 8835fcb..188d437 100644
Binary files a/app/assets/images/push-notifications/posted.png and b/app/assets/images/push-notifications/posted.png differ
diff --git a/app/assets/images/push-notifications/private_message.png b/app/assets/images/push-notifications/private_message.png
index 2f1d97b..34656ea 100644
Binary files a/app/assets/images/push-notifications/private_message.png and b/app/assets/images/push-notifications/private_message.png differ
diff --git a/app/assets/images/push-notifications/quoted.png b/app/assets/images/push-notifications/quoted.png
index 16d44dd..2fb2e33 100644
Binary files a/app/assets/images/push-notifications/quoted.png and b/app/assets/images/push-notifications/quoted.png differ
diff --git a/app/assets/images/push-notifications/replied.png b/app/assets/images/push-notifications/replied.png
index 8835fcb..188d437 100644
Binary files a/app/assets/images/push-notifications/replied.png and b/app/assets/images/push-notifications/replied.png differ
diff --git a/lib/tasks/images.rake b/lib/tasks/images.rake
index b74a772..ff587a7 100644
--- a/lib/tasks/images.rake
+++ b/lib/tasks/images.rake
@@ -2,11 +2,12 @@ require_dependency "file_helper"
 
 task "images:compress" => :environment do
   images = Dir.glob("#{Rails.root}/app/**/*.png")
-  image_sizes = Hash[*images.map { |i| [i, File.size(i)] }.to_a.flatten]
-  FileHelper.optimize_images!(images) do |name, optimized|
-    if optimized
-      new_size = File.size(name)
-      puts "#{name} => from: #{image_sizes[name.to_s]} to: #{new_size}"
+  image_sizes = images.map { |i| [i, File.size(i)] }.to_h
+
+  images.each do |path|
+    if FileHelper.optimize_image!(path)
+      new_size = File.size(path)
+      puts "#{path} => from: #{image_sizes[path]} to: #{new_size}"
     end
   end
 end

GitHub sha: a6a52d15


Approved #2