pruview 0.0.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 69deca635616fe199062380351080f374c6eb077
4
+ data.tar.gz: 029aff7194581cd3074ce76d4202d17a62c0fc06
5
+ SHA512:
6
+ metadata.gz: 49cec2792bcf77699bb25b0d796d45f7f8979e36e9ca08416bd0c168f6c970d03b66fbe93e472d00d1f7cbce7cae9d250df1f534be0134973a2f1e965df6d48e
7
+ data.tar.gz: 6c1daedd948734e5807ad326b43ccf80a7aa54217ef88239d5ce8d868a5c56671494f2e730858c3567c450df45835b77117978ed44683960d9a7dadf5ed75e2a
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.log
3
+ *.rbc
4
+ .rbx/
5
+ .bundle
6
+ .config
7
+ .yardoc
8
+ Gemfile.lock
9
+ InstalledFiles
10
+ _yardoc
11
+ coverage
12
+ doc/
13
+ lib/bundler/man
14
+ pkg
15
+ rdoc
16
+ spec/reports
17
+ test/tmp
18
+ test/version_tmp
19
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem 'pry', "~> 0.9.0"
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2007-Present Kelly Redding and Collin Redding
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,64 @@
1
+ # Pruview
2
+
3
+ Generate image previews (thumbnails) in Ruby. **Note**: this is a fork/copy and rework/modernization of the original kelredd-pruview gem: https://github.com/kellyredding/pruview.
4
+
5
+ ## Usage
6
+
7
+ ```ruby
8
+ require 'pruview'
9
+
10
+ # Thumbnail an image (using image magick)
11
+
12
+ src_img_file = '/path/to/src/file'
13
+ dest_root_dir = '/path/to/dest'
14
+ file_name = 'my_thumb'
15
+ px_width = 600
16
+ px_height = 400
17
+
18
+ src_img = Pruview::Document.new(src_img_file, dest_root_dir)
19
+ dest_img_path = src_img.to_jpg(file_name, px_width, px_height)
20
+
21
+ # Thumbnail a video frame
22
+ # - ffmpeg to get a frame image from the movie
23
+ # - then image magick to resize that frame image
24
+
25
+ src_vid_file = '/path/to/src/video'
26
+ dest_root_dir = '/path/to/dest'
27
+ file_name = 'my_video_thumb'
28
+ px_width = 600
29
+ px_height = 400
30
+
31
+ vid_img_path = Pruview::VideoImage.to_jpg(src_vid_file, dest_root_dir, file_name)
32
+ vid_img = Pruview::Document.new(vid_img_path, dest_root_dir)
33
+ dest_vid_img_path = vid_img.to_jpg(file_name, px_width, px_height)
34
+ ```
35
+
36
+ ## Dependencies
37
+
38
+ * image magick + any special file type handling dependencies
39
+ * ffmpeg + h264 encoder + any special file type handling dependencies (for video previewing)
40
+ * gawk
41
+ * mini_magick gem
42
+ * flvtool2 gem
43
+
44
+ ## Installation
45
+
46
+ Add this line to your application's Gemfile:
47
+
48
+ gem 'pruview'
49
+
50
+ And then execute:
51
+
52
+ $ bundle
53
+
54
+ Or install it yourself as:
55
+
56
+ $ gem install pruview
57
+
58
+ ## Contributing
59
+
60
+ 1. Fork it
61
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
62
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
63
+ 4. Push to the branch (`git push origin my-new-feature`)
64
+ 5. Create new Pull Request
@@ -0,0 +1,4 @@
1
+ require "pruview/version"
2
+
3
+ module Pruview
4
+ end
@@ -0,0 +1,3 @@
1
+ module Pruview
2
+ VERSION = "0.0.1"
3
+ end
File without changes
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "pruview/version"
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "pruview"
8
+ gem.version = Pruview::VERSION
9
+ gem.authors = ["Kelly Redding", "Collin Redding"]
10
+ gem.email = ["kelly@kellyredding.com", "collin.redding@me.com"]
11
+ gem.summary = "generate image previews (thumbnails) in Ruby"
12
+ gem.description = "generate image previews (thumbnails) in Ruby"
13
+ gem.homepage = "http://github.com/redding/pruview"
14
+ gem.license = 'MIT'
15
+
16
+ gem.files = `git ls-files`.split($/)
17
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
+ gem.require_paths = ["lib"]
20
+
21
+ gem.add_development_dependency("assert", ["~> 2.16.1"])
22
+
23
+ gem.add_dependency("mini_magick", ["~> 3.0"])
24
+ gem.add_dependency("flvtool2")
25
+
26
+ end
@@ -0,0 +1,19 @@
1
+ # this file is automatically required when you run `assert`
2
+ # put any test helpers here
3
+
4
+ # add the root dir to the load path
5
+ $LOAD_PATH.unshift(File.expand_path("../..", __FILE__))
6
+
7
+ # require pry for debugging (`binding.pry`)
8
+ require 'pry'
9
+
10
+ require 'test/support/factory'
11
+
12
+ # 1.8.7 backfills
13
+
14
+ # Array#sample
15
+ if !(a = Array.new).respond_to?(:sample) && a.respond_to?(:choice)
16
+ class Array
17
+ alias_method :sample, :choice
18
+ end
19
+ end
@@ -0,0 +1,6 @@
1
+ require 'assert/factory'
2
+
3
+ module Factory
4
+ extend Assert::Factory
5
+
6
+ end
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pruview
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kelly Redding
8
+ - Collin Redding
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2016-06-16 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: assert
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 2.16.1
23
+ type: :development
24
+ version_requirements: *id001
25
+ - !ruby/object:Gem::Dependency
26
+ name: mini_magick
27
+ prerelease: false
28
+ requirement: &id002 !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: "3.0"
33
+ type: :runtime
34
+ version_requirements: *id002
35
+ - !ruby/object:Gem::Dependency
36
+ name: flvtool2
37
+ prerelease: false
38
+ requirement: &id003 !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - &id004
41
+ - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ type: :runtime
45
+ version_requirements: *id003
46
+ description: generate image previews (thumbnails) in Ruby
47
+ email:
48
+ - kelly@kellyredding.com
49
+ - collin.redding@me.com
50
+ executables: []
51
+
52
+ extensions: []
53
+
54
+ extra_rdoc_files: []
55
+
56
+ files:
57
+ - .gitignore
58
+ - Gemfile
59
+ - LICENSE
60
+ - README.md
61
+ - lib/pruview.rb
62
+ - lib/pruview/version.rb
63
+ - log/.gitkeep
64
+ - pruview.gemspec
65
+ - test/helper.rb
66
+ - test/support/factory.rb
67
+ - tmp/.gitkeep
68
+ homepage: http://github.com/redding/pruview
69
+ licenses:
70
+ - MIT
71
+ metadata: {}
72
+
73
+ post_install_message:
74
+ rdoc_options: []
75
+
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - *id004
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - *id004
84
+ requirements: []
85
+
86
+ rubyforge_project:
87
+ rubygems_version: 2.6.4
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: generate image previews (thumbnails) in Ruby
91
+ test_files:
92
+ - test/helper.rb
93
+ - test/support/factory.rb