Skip to content

Commit d3edcba

Browse files
committed
Follow recommendations to squish pictures harder
1 parent 77f6779 commit d3edcba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/cheesy-gallery/image_file.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ def process_and_write(img, path)
4040
img.change_geometry!(@max_size) do |cols, rows, i|
4141
i.resize!(cols, rows)
4242
end
43+
# follow recommendations from https://stackoverflow.com/a/7262050/4918 to get better compression
44+
img.interlace = Magick::PlaneInterlace
45+
# but skip the blur to avoid too many changes to the data
46+
# img.gaussian_blur(0.05)
47+
img.strip!
4348
# workaround weird {self} initialisation pattern
4449
quality = @quality
4550
img.write(path) { self.quality = quality }

0 commit comments

Comments
 (0)