photile 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -5
- data/bin/photile +3 -3
- data/lib/photile.rb +1 -1
- data/lib/photile/cli.rb +1 -1
- data/test/test_requirements.rb +1 -1
- metadata +2 -2
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
|
-
$
|
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-
|
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-
|
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
|
-
###
|
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
|
-
`
|
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
|
-
|
20
|
+
config[:infile] = config[:outfile]
|
21
|
+
end
|
data/lib/photile.rb
CHANGED
data/lib/photile/cli.rb
CHANGED
data/test/test_requirements.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2013-01-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|