Skip to content

Commit

Permalink
Update photo_gen.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
s7uck authored Aug 18, 2024
1 parent 02b1b43 commit 268942b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions _plugins/photo_gen.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require "mini_exiftool"
require "webp_ffi"

module Jekyll
class PhotoPageGenerator < Generator
Expand Down Expand Up @@ -36,7 +35,6 @@ def generate(site)
dest = File.join(site.dest, photo_url)
FileUtils.mkdir_p dest
image_filename = File.join(photo_url, filename + file_extension)
preview_filename = File.join(photo_url, filename + '.webp')

begin
pic = MiniExiftool.new(photo)
Expand All @@ -62,7 +60,6 @@ def generate(site)
'location' => location,
'camera' => camera,
'image' => image_filename,
'preview_image' => preview_filename,
'aperture' => aperture,
'sspeed' => sspeed,
'iso' => iso,
Expand All @@ -79,7 +76,6 @@ def generate(site)

site.pages << photo_page
FileUtils.cp(File.expand_path(photo), dest)
WebP.encode(File.expand_path(photo), File.join(dest, preview_filename), target_size: 524288)
rescue
puts "#{photo} didn't work"
end
Expand Down

0 comments on commit 268942b

Please sign in to comment.