Skip to content

Commit

Permalink
FIX: images:compress rake task
Browse files Browse the repository at this point in the history
Optimized a few unoptimized PNGs.
  • Loading branch information
ZogStriP committed Mar 15, 2019
1 parent 45a97ad commit a6a52d1
Show file tree
Hide file tree
Showing 19 changed files with 6 additions and 5 deletions.
Binary file modified app/assets/images/favicons/google_branding/logo_calendar_128px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/favicons/google_branding/logo_calendar_48px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/favicons/google_branding/logo_docs_48px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/favicons/google_branding/logo_drive_48px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/favicons/google_branding/logo_forms_48px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/favicons/google_branding/logo_sheets_48px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/favicons/google_branding/logo_slides_48px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/favicons/pdf_48px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/favicons/pdf_64px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/push-notifications/check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/push-notifications/discourse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/push-notifications/group_mentioned.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/push-notifications/linked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/push-notifications/mentioned.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/push-notifications/posted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/push-notifications/private_message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/push-notifications/quoted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/push-notifications/replied.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions lib/tasks/images.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a6a52d1

Please sign in to comment.