jekyll-galleries 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +4 -0
  3. data/lib/jekyll/galleries.rb +9 -6
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0489231e919c218babd6617e37e913be0dd8c72d
4
- data.tar.gz: f22848c946b32ac8f1214b92e1ef0c0c9a5abf6d
3
+ metadata.gz: 97094652304097fd23bedda6bd418b77c8aa6c36
4
+ data.tar.gz: 5e750d11dfc95fbef20ad81222bc5f62ea46948e
5
5
  SHA512:
6
- metadata.gz: f34067a34ac82992965a482fce1feb0052eba6db5ce772f3083b9a2d0972d19f58a1d7472d0c7d0486c251d7ada79ad69564c181b297e05598d17687c6e424d5
7
- data.tar.gz: 8a88da9bbc312697178aa02018ccc8f79defbc429e947a0765d30d4547e5f8fcd725fcb1727a1eacb1227bb001e6fdcb94c4988ec78327595390ec356131bdbb
6
+ metadata.gz: 0298c72a757f8b41a5cacb7fa15d0b3d83b178a948743146828d4ad8eafe2a46504861ea881714fb1c6c80059d17d7f5b5568931b28ebdb29d97e19d8d965ab7
7
+ data.tar.gz: c063ffd4cb8d39d9a77133d90ce44425d47ee9b164852db4457a0c74f74b46f436f7e4ff5c66a74fb144b5abd1f7bc061ac06fffa65dd11cc8eaccdcb94f3ea1
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.8.1 [2014-05-07]
2
+
3
+ * Fixed bug: thumbnail generation not working
4
+
1
5
  == 0.8.0 [2014-03-13]
2
6
 
3
7
  * Add `top` as an attribute, for putting an gallery on the top of index page
@@ -1,6 +1,6 @@
1
1
  require 'RMagick'
2
+ require 'exifr'
2
3
  include Magick
3
-
4
4
  include FileUtils
5
5
 
6
6
  module Jekyll
@@ -25,7 +25,6 @@ module Jekyll
25
25
  site.data['galleries'] = []
26
26
 
27
27
  gallery_dirs = Dir["#{site.source}/#{gallery_dir}/*/"].select { |e| File.directory? e }
28
- gallery_dirs.reverse! # in order to sort by date desc
29
28
  gallery_dirs.each do |dir|
30
29
  generate_gallery_page(dir)
31
30
  end
@@ -90,12 +89,17 @@ module Jekyll
90
89
  self.data['url'] = URI.escape self.url
91
90
 
92
91
  # For each photo, initial attributes are `filename` and `url`
93
- photos = Dir["#{self.gallery_dir}/*"].map { |e| { filename: File.basename(e), url: URI.escape("/#{self.gen_dir}/#{self.gallery_dir_name}/#{File.basename e}") } } # basic photos attributes
92
+ photos = Dir["#{self.gallery_dir}/*"].map { |e| { file: File.new(e), filename: File.basename(e), url: URI.escape("/#{self.gen_dir}/#{self.gallery_dir_name}/#{File.basename e}") } } # basic photos attributes
94
93
 
95
94
  self.data['photos'] = [] # storing an array of Photo
96
95
  photos.each do |photo|
97
- photo_data = {}
98
96
  photo_data = photos_config.find { |e| e['filename'] == photo[:filename] } if photos_config
97
+ photo_data ||= {}
98
+ begin
99
+ photo_data['date'] = EXIFR::JPEG.new(photo[:file].path).date_time.strftime("%F %R")
100
+ rescue
101
+ puts "#{photo[:file].path}: cannot load date"
102
+ end
99
103
 
100
104
  self.data['photos'] << Photo.new(@site, photo[:filename], self, photo_data)
101
105
  end
@@ -145,7 +149,6 @@ module Jekyll
145
149
  self.data['filename'] = filename
146
150
  self.filename = filename
147
151
 
148
-
149
152
  @thumbs_dir = site.config['thumbnails_dir']
150
153
  generate_thumbnails if @thumbs_dir
151
154
 
@@ -159,7 +162,7 @@ module Jekyll
159
162
  size_x = @site.config['thumbnail_x'] || 100
160
163
  size_y = @site.config['thumbnail_y'] || 100
161
164
 
162
- full_thumbs_path = "#{@site.dest}/#{@thumbs_dir}/#{@gallery.gallery_dir_name}"
165
+ full_thumbs_path = "#{@thumbs_dir}/#{@gallery.gallery_dir_name}"
163
166
  FileUtils.mkdir_p(full_thumbs_path, :mode => 0755)
164
167
  if File.file?("#{full_thumbs_path}/#{self.filename}") == false or File.mtime("#{@gallery.gallery_dir}/#{self.filename}") > File.mtime("#{full_thumbs_path}/#{self.filename}")
165
168
  begin
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-galleries
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - allenlsy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-13 00:00:00.000000000 Z
11
+ date: 2014-05-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Jekyll plugin to automatically generate photo gallery (album) from image
14
14
  folder.
@@ -32,7 +32,7 @@ rdoc_options:
32
32
  - --line-numbers
33
33
  - --all
34
34
  - --title
35
- - jekyll-galleries Application documentation (v0.8.0)
35
+ - jekyll-galleries Application documentation (v0.8.1)
36
36
  - --main
37
37
  - ChangeLog
38
38
  require_paths: