photile 0.1.6 → 0.1.7

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/README.md CHANGED
@@ -11,7 +11,7 @@ One scenario where this is really useful is image processing for product images.
11
11
 
12
12
  ```bash
13
13
  # https://rubygems.org/gems/gem
14
- $ photile install photile
14
+ $ gem install photile
15
15
  ```
16
16
 
17
17
  ### Examples
@@ -29,7 +29,7 @@ Usage: photile [options] infile outfile
29
29
  # Basic Examples
30
30
  $ photile --quality 80 image-in image-out
31
31
  $ photile --compress image-in image-out
32
- $ photile --watermark image-in image-watermark image-out
32
+ $ photile --watermark image-watermark image-in image-out
33
33
  $ photile --tile WIDTHxHEIGHT image-in image-out
34
34
 
35
35
  # Advanced Examples
@@ -38,7 +38,7 @@ $ photile --tile WIDTHxHEIGHT image-in image-out
38
38
  $ photile --quality 80 --compress image-in image-out
39
39
 
40
40
  # 2. Watermark 'image-in' with 'image-watermark' and then tile it with size 'WIDTHxHEIGHT' to produce '[image-out-0...image-out-n]'
41
- $ photile --watermark --tile WIDTHxHEIGHT image-in image-watermark image-out
41
+ $ photile --watermark image-watermark --tile WIDTHxHEIGHT image-in image-out
42
42
 
43
43
  # 3. Reduce quality % of 'image-in', then compress it and watermark it with 'image-watermark'. Finally, tile the watermarked image to produce '[image-out-0...image-out-n]'
44
44
  $ photile --quality QUALITY --compress --watermark image-watermark --tile WIDTHxHEIGHT image-in image-out
@@ -55,15 +55,16 @@ Here are the piping scenarios available
55
55
  * Watermarking: `IMAGE` + `WATERMARK IMAGE` → `Watermarker` → `IMAGE`
56
56
  * Tiling: `IMAGE` → `Tiler` → `[IMAGE...IMAGE]`
57
57
 
58
- ### Moreoe
58
+ ### More
59
59
 
60
60
  Photile uses the amazing [Imagemagick](http://www.imagemagick.org/script/index.php) 6.6.9-7 and [Jpegtran](http://jpegclub.org/jpegtran/) 1.2.0 libraries. Imagemagick provides quality, watermarking and tiling properties. Jpegtran provides the loss-less compression. In other words, `photile` is just a layer on top of existing libraries to make certain image processing tasks dead simple. Additionally since `photile` is a gem it can be used directly in Rails to create dynamic workflows.
61
61
 
62
62
  ### TODO
63
63
 
64
+ - Documentation
64
65
  - CLI option to show version
65
66
  - File validation for infile/outfile
66
67
  - More unit tests to ensure that all pipe permutations work
67
68
 
68
69
  * * *
69
- Copyright (c) 2013 Nitin Dhar. See [MIT-LICENSE](MIT-LICENSE) for details.
70
+ Copyright (c) 2013 Nitin Dhar. See [MIT-LICENSE](MIT-LICENSE) for details.
data/bin/photile CHANGED
@@ -10,12 +10,12 @@ config[:options].each do |opt|
10
10
  when :quality
11
11
  `convert #{config[:infile]} -quality #{val} #{config[:outfile]}`
12
12
  when :compress
13
- `cp #{config[:infile]} #{config[:outfile]} && jpegtran -copy none -optimize -perfect -outfile #{config[:outfile]} #{config[:outfile]}`
13
+ `jpegtran -copy none -optimize -perfect -outfile #{config[:outfile]} #{config[:outfile]}`
14
14
  when :watermark
15
15
  `composite -gravity center #{val} #{config[:infile]} #{config[:outfile]}`
16
16
  when :tile
17
17
  `convert #{config[:infile]} -crop #{val[:width]}x#{val[:height]} +repage +adjoin #{config[:outfile].split('.').join('%03d.')}`
18
18
  end
19
- config[:infile] = config[:outfile]
20
19
  end
21
- end
20
+ config[:infile] = config[:outfile]
21
+ end
data/lib/photile.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class Photile
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
4
4
 
5
5
  require 'photile/cli'
data/lib/photile/cli.rb CHANGED
@@ -55,4 +55,4 @@ class Photile::Cli
55
55
  exit
56
56
  end
57
57
  end
58
- end
58
+ end
@@ -7,4 +7,4 @@ class RequirementsTest < Test::Unit::TestCase
7
7
  assert_not_nil `which composite`
8
8
  assert_not_nil `which jpegtran`
9
9
  end
10
- end
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: photile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-16 00:00:00.000000000 Z
12
+ date: 2013-01-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake