christiank-make_thumbs 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/make_thumbs +32 -0
- metadata +63 -0
data/bin/make_thumbs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/ruby
|
|
2
|
+
#
|
|
3
|
+
# make_thumbs.rb v1.0.0
|
|
4
|
+
#
|
|
5
|
+
|
|
6
|
+
unless ARGV.length == 3
|
|
7
|
+
puts "Usage: make_thumbs [geometry string] [original dir] [thumbs dir]"
|
|
8
|
+
exit 1
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
require 'rubygems'
|
|
12
|
+
require 'rmagick'
|
|
13
|
+
include Magick
|
|
14
|
+
|
|
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
|
+
geometry_string = ARGV[0]
|
|
22
|
+
image_dir = ARGV[1]
|
|
23
|
+
thumb_dir = ARGV[2]
|
|
24
|
+
|
|
25
|
+
Dir.mkdir(thumb_dir) unless File.directory?(thumb_dir)
|
|
26
|
+
|
|
27
|
+
Dir.entries_visible(image_dir).each do |image_name|
|
|
28
|
+
pic = ImageList.new "#{image_dir}/#{image_name}"
|
|
29
|
+
type = File.extname image_name
|
|
30
|
+
resized = pic.change_geometry(geometry_string) { |cols, rows, img| img.resize(cols, rows) }
|
|
31
|
+
resized.write "#{thumb_dir}/#{image_name.sub( type, %Q(-thumb#{type}) )}"
|
|
32
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: christiank-make_thumbs
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Christian Koch
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
|
|
12
|
+
date: 2009-07-30 00:00:00 -07:00
|
|
13
|
+
default_executable:
|
|
14
|
+
dependencies:
|
|
15
|
+
- !ruby/object:Gem::Dependency
|
|
16
|
+
name: rmagick
|
|
17
|
+
type: :runtime
|
|
18
|
+
version_requirement:
|
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
20
|
+
requirements:
|
|
21
|
+
- - ">="
|
|
22
|
+
- !ruby/object:Gem::Version
|
|
23
|
+
version: 2.11.0
|
|
24
|
+
version:
|
|
25
|
+
description:
|
|
26
|
+
email: ckoch002@student.ucr.edu
|
|
27
|
+
executables:
|
|
28
|
+
- make_thumbs
|
|
29
|
+
extensions: []
|
|
30
|
+
|
|
31
|
+
extra_rdoc_files: []
|
|
32
|
+
|
|
33
|
+
files:
|
|
34
|
+
- bin/make_thumbs
|
|
35
|
+
has_rdoc: false
|
|
36
|
+
homepage: http://github.com/christiank/make_thumbs
|
|
37
|
+
licenses:
|
|
38
|
+
post_install_message:
|
|
39
|
+
rdoc_options: []
|
|
40
|
+
|
|
41
|
+
require_paths:
|
|
42
|
+
- lib
|
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: "0"
|
|
48
|
+
version:
|
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: "0"
|
|
54
|
+
version:
|
|
55
|
+
requirements: []
|
|
56
|
+
|
|
57
|
+
rubyforge_project:
|
|
58
|
+
rubygems_version: 1.3.5
|
|
59
|
+
signing_key:
|
|
60
|
+
specification_version: 2
|
|
61
|
+
summary: Simple mass thumbnailing with RMagick
|
|
62
|
+
test_files: []
|
|
63
|
+
|