Skip to content

Commit

Permalink
verify that images comply to 32x32 convention
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyakatz committed Oct 14, 2014
1 parent 127018a commit e198e66
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ gem 'github-pages', '~> 21'
gem 'jekyll', '~> 2.2.0'
gem 'kramdown', '~> 1.3.1'
gem 'rake'

gem 'fastimage'
11 changes: 10 additions & 1 deletion verify.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Load Yaml
require 'yaml'
require 'fastimage'

begin

Expand All @@ -10,9 +11,17 @@
data = YAML.load_file('_data/' + section["id"] + '.yml')

data['websites'].each do |website|
unless File.exists?("img/#{section['id']}/#{website['img']}")
image = "img/#{section['id']}/#{website['img']}"

unless File.exists?(image)
raise "#{website['name']} image not found."
end

image_dimensions = [32,32]

unless FastImage.size(image) == image_dimensions
raise "Image for #{website['img']} is not #{image_dimensions.join("x")}"
end
end
end

Expand Down

0 comments on commit e198e66

Please sign in to comment.