phototrim 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +15 -0
  2. data/lib/phototrim.rb +25 -0
  3. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NjVhMmFhOTA0MzNhOThmOGM5Yjc3MWI5NTc4NjcwOWNmNDYyYTRhMw==
5
+ data.tar.gz: !binary |-
6
+ NTI4N2VlN2NkM2QxZjEwYzJjZjllYjI4NTQ3YTkzZDU0YTZjMzY1NA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YWQxNzk5MTk4Y2UwYmRkN2E1OWJjMzE1ZjZhNzg0Yzg0MjdmMTdiOWIzNDBl
10
+ OWYxY2VjMWY4OGM3YzZmMmVjMzI2NWM1MTAyODJhZTdkNGM3ZDAzY2Q3ZWQ1
11
+ Y2Y0NTBhZmJlMjQyMTczNDg2ZWYyYzlhNzZlYmIwZmQ2NGU4ODI=
12
+ data.tar.gz: !binary |-
13
+ MWRmMjM2ZjQyMDNmOWQ0ODE4ZWM0NWVlNWRlYTIxZjA4NGRlYmQ2YTkxOTQ0
14
+ OTE2MjU0MDQwZWMzOTBiZDBlMzRhMGNlMTgyOTUwNDEyMGE5YTdhOTgxNDUz
15
+ OGIwNjE4NTkwNzJiNjNlNDc0MTJlMDVkNDM5MTA3MDI3ODcwNjU=
data/lib/phototrim.rb ADDED
@@ -0,0 +1,25 @@
1
+ #! /usr/local/bin/ruby -w
2
+ # Sarup Banskota, 1 December 2014
3
+
4
+ require 'RMagick'
5
+ include Magick
6
+
7
+ Dir.foreach('images') do |subdir|
8
+ unless subdir == "." or subdir == ".."
9
+ print "Processing images within " + subdir.to_s + "\n"
10
+ Dir.foreach(File.join("images", subdir)) do |victimfile|
11
+ unless victimfile == "." or victimfile == ".."
12
+ print "Processing file " + victimfile + "\n"
13
+ victim = ImageList.new(File.join("images", subdir, victimfile))
14
+ if victim.columns > 640
15
+ print victimfile.to_s + " is beyond 640px wide, scaling down.. \n"
16
+ victim = victim.scale(640.0/victim.columns)
17
+ print "Scaled down " + victimfile.to_s + ".\n"
18
+ victim.write(File.join("images", subdir, victimfile))
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ exit
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: phototrim
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Sarup Banskota
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-01 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Scales photos down to neat-ify blogs
14
+ email: sarupbanskota@fedoraproject.org
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/phototrim.rb
20
+ homepage: http://rubygems.org/gems/phototrim
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.2.2
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Phototrim
44
+ test_files: []
45
+ has_rdoc: