christiank-make_thumbs 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/make_thumbs +4 -9
- metadata +12 -2
data/bin/make_thumbs
CHANGED
@@ -9,15 +9,10 @@ unless ARGV.length == 3
|
|
9
9
|
end
|
10
10
|
|
11
11
|
require 'rubygems'
|
12
|
+
require 'entries_visible'
|
12
13
|
require 'rmagick'
|
13
14
|
include Magick
|
14
15
|
|
15
|
-
class Dir
|
16
|
-
def Dir.entries_visible dir
|
17
|
-
return Dir.entries(dir).delete_if { |entry| entry[0, 1] == '.' }
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
16
|
geometry_string = ARGV[0]
|
22
17
|
image_dir = ARGV[1]
|
23
18
|
thumb_dir = ARGV[2]
|
@@ -25,8 +20,8 @@ thumb_dir = ARGV[2]
|
|
25
20
|
Dir.mkdir(thumb_dir) unless File.directory?(thumb_dir)
|
26
21
|
|
27
22
|
Dir.entries_visible(image_dir).each do |image_name|
|
28
|
-
|
23
|
+
pic = ImageList.new "#{image_dir}/#{image_name}"
|
29
24
|
type = File.extname image_name
|
30
|
-
|
31
|
-
|
25
|
+
resized = pic.change_geometry(geometry_string) { |cols, rows, img| img.resize(cols, rows) }
|
26
|
+
resized.write "#{thumb_dir}/#{image_name.sub( type, %Q(-thumb#{type}) )}"
|
32
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: christiank-make_thumbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Koch
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-31 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,6 +22,16 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 2.11.0
|
24
24
|
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: christiank-entries_visible
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.0
|
34
|
+
version:
|
25
35
|
description:
|
26
36
|
email: ckoch002@student.ucr.edu
|
27
37
|
executables:
|