Skip to content

Commit

Permalink
More optimization for add to home screen article
Browse files Browse the repository at this point in the history
  • Loading branch information
rossta committed Dec 15, 2024
1 parent d52eb12 commit 2ba3bed
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
6 changes: 3 additions & 3 deletions script/convert-webp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

require "fastimage"

force = false
force = true

class ImageFile
def exists?
Expand Down Expand Up @@ -83,8 +83,8 @@ module Cmd
end
end

def self.jpg(img, force: false, quality: 90, tries: 0)
dest = img.as_opt_jpg.to_s
def self.jpg(img, dest: nil, force: false, quality: 90, tries: 0)
dest ||= img.as_opt_jpg.to_s
if force || !File.exist?(dest)
run "magick #{img} -strip -interlace Plane -quality #{quality}% #{dest}"

Expand Down

0 comments on commit 2ba3bed

Please sign in to comment.