photish 0.5.3 → 0.6.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.
- checksums.yaml +8 -8
- data/.travis.yml +1 -7
- data/README.md +40 -0
- data/TODO.md +0 -4
- data/lib/photish/config/default_config.rb +15 -1
- data/lib/photish/render/image.rb +22 -1
- data/lib/photish/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjhjN2EzYzNmNjVkNGI0YjVlYmU5OWUxYjJmYjBkZDgzODY5NWMzMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzEwNmIxNzdjNDkwOTkzMTYyOGZlMDJlYjViMjUyNTlkYTdlOWZhNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGRjOGY1Nzg4Mjk3OThjOWQ2MTEwNzVkZjk3MzQ3MDkwMTJlYjdhMTFmYWQw
|
10
|
+
ZmMzZTU3NjJiMmYzYzNiZDk5NWNmNmFkOTRmN2I5ZTNjNDg0YWZiZDNjOGFm
|
11
|
+
YTQ4NmUzYzUwN2UyYTc1YmQxOWU0OWFkY2MxOTRkNzJmODhkZjE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTk3NTM5ZTE1MjY5ZDYyYzFiZGI0ZjM5NzUyZTcyNGM0YTU1NmVhODY0NzE1
|
14
|
+
OWU5Yjg1NzE5ZjQ2YWJjNTJmYjNjNmU3ZTMxM2M3YjExZmZhMzE4YTg5OTA0
|
15
|
+
ZGQ4MzFjZjBiYWI0MWUxZmU0OTk1YmY4ZmU4OWUyZGI0N2U2YzY=
|
data/.travis.yml
CHANGED
@@ -13,32 +13,26 @@ addons:
|
|
13
13
|
cache: bundler
|
14
14
|
matrix:
|
15
15
|
include:
|
16
|
-
- rvm: ruby-head
|
17
16
|
- rvm: 2.3.0
|
18
17
|
env: COVERAGE=1 DEPLOY=1
|
19
18
|
- rvm: 2.2
|
20
19
|
- rvm: 2.1
|
21
20
|
- rvm: 2.0
|
22
21
|
|
23
|
-
- rvm: jruby-head
|
24
22
|
- rvm: jruby-9.0
|
25
23
|
env: SMOKE_TEST_ONLY=1
|
26
24
|
|
27
|
-
- rvm: rbx
|
28
25
|
- rvm: rbx-3.2
|
29
26
|
env: SMOKE_TEST_ONLY=1
|
30
27
|
- rvm: rbx-2.7
|
31
28
|
env: SMOKE_TEST_ONLY=1
|
32
29
|
fast_finish: true
|
33
|
-
allow_failures:
|
34
|
-
- rvm: ruby-head
|
35
|
-
- rvm: jruby-head
|
36
|
-
- rvm: rbx
|
37
30
|
deploy:
|
38
31
|
provider: rubygems
|
39
32
|
on:
|
40
33
|
repo: henrylawson/photish
|
41
34
|
condition: "$DEPLOY = 1"
|
35
|
+
branch: master
|
42
36
|
tags: true
|
43
37
|
api_key:
|
44
38
|
secure: nFNY85dNmvdhc8H2t/tIiv0xTeWctitZSs2WtlVzOFpbNFac9rqd4ZhNQb/l2QiukquMdbWVzSr2uPZ+gJwhV/yWtX+xNbnPHdW/u5upX5PO9SNZImx8iVS95bViW+zygp3rZvVS6oVeIg4xAzuBMlviomYhp8lGRISWAM5efznK+NkLw16BiiDVQQ3KKLst0Ydo2TIzjkpfeFyNK9qj0Joxqllojo+QVBFUN+vHQcC2VgOQIJjCKshlRKDtMwvvt5+qjBPs5IsTwWkySkkum3WRLxwUXHoMqKqxbYfgXtr2A7KUKiGkK9L2zVYOYCErKDuS+YgQ3AgxnFsToOR8hp6SRv1WhR8Vix67u3A7dRmJ1hdyt0Re5+LyvHAuKXuUB6gJ8rbWpf56i4fbGCjl9IVE4YB+PfwRDwBAttXQTtYZE7AuseH+qdUYPRq3zLlYIcFxEliyNhh5Ud8aBh+ciM2R7ql0wA2Fu8tOK/2beoBWjifZc0z/B/hDHO4JGsphJaz59wPk/3DV6sCmaS4iMPAKtoyRdTyUN/hnzpq99LOEoQLCWUteWet5saV0svOQ3THRTZYO2mUX18Yb1Xjrm6iGhpjOMueBn+X12WLSXgHLuWV07/30cFdUOuhrGGu68weoMUY060PIdslUFtygSWIVVtvDpX1W52MLZyINeaA=
|
data/README.md
CHANGED
@@ -74,6 +74,7 @@ and running:
|
|
74
74
|
- [Asset Page](#asset-page)
|
75
75
|
- [Generate](#generate)
|
76
76
|
- [Execution Order](#execution-order)
|
77
|
+
- [Image Conversion Tools](#image-conversion-tools)
|
77
78
|
- [Workers and Threads](#workers-and-threads)
|
78
79
|
- [Caching](#caching)
|
79
80
|
- [Automatic Rengeneration](#automatic-regeneration)
|
@@ -360,6 +361,11 @@ force: false
|
|
360
361
|
plugins: ['ssh_deploy', 'other_plugin']
|
361
362
|
image_extensions: ['jpg', 'gif']
|
362
363
|
page_extension: 'slim'
|
364
|
+
dependencies:
|
365
|
+
minimagick:
|
366
|
+
cli: 'imagemagick'
|
367
|
+
cli_path:
|
368
|
+
timeout: 3600
|
363
369
|
```
|
364
370
|
|
365
371
|
The meanings and purpose of each field is defined below:
|
@@ -389,6 +395,11 @@ Field | Purpose
|
|
389
395
|
`plugins` | an array of plugin names that have been included in your Gemfile and that Photish should require into it's runtime
|
390
396
|
`image_extensions` | by default, Photish has a complete list of image extensions, however if you choose too, you can explicitly list the extensions that Photish should use to find images
|
391
397
|
`page_extension` | the extension of **Pages** files that will live amongst the photo collection
|
398
|
+
`dependencies` | this section is for the configuration of third party tools
|
399
|
+
`dependencies/minimagick` | configuration for [minimagick](https://github.com/minimagick/minimagick), the wrapping library around [ImageMagick](http://www.imagemagick.org/) or [GraphicsMagick](http://www.graphicsmagick.org/)
|
400
|
+
`dependencies/minimagick/cli` | provide `imagemagick`, or `graphicsmagick` depending on your chosen library
|
401
|
+
`dependencies/minimagick/cli_path` | if the above executables are not in your PATH, you can provide it explicitly here
|
402
|
+
`dependencies/minimagick/timeout` | terminate a command after the provided number of seconds
|
392
403
|
|
393
404
|
#### Customizing Templates
|
394
405
|
|
@@ -651,6 +662,35 @@ The Generate command does the following:
|
|
651
662
|
1. Converts all Photo(s) to the configured quality versions, writing various
|
652
663
|
images to the `output` folder
|
653
664
|
|
665
|
+
#### Image Conversion Tools
|
666
|
+
|
667
|
+
Photish supports [ImageMagick](http://www.imagemagick.org/) or
|
668
|
+
[GraphicsMagick](http://www.graphicsmagick.org/) for image conversion.
|
669
|
+
|
670
|
+
By default, Photish will assume [ImageMagick](http://www.imagemagick.org/) is
|
671
|
+
installed. To change this, ensure
|
672
|
+
[GraphicsMagick](http://www.graphicsmagick.org/) is installed and the utility
|
673
|
+
is availabe on the PATH. Then ensure that the [Config File
|
674
|
+
Option](#config-file-option) `dependencies/minimagick/cli` is set to
|
675
|
+
`graphicsmagick`. For example:
|
676
|
+
|
677
|
+
```yaml
|
678
|
+
dependencies:
|
679
|
+
minimagick:
|
680
|
+
cli: graphicsmagick
|
681
|
+
```
|
682
|
+
|
683
|
+
If [ImageMagick](http://www.imagemagick.org/) or
|
684
|
+
[GraphicsMagick](http://www.graphicsmagick.org/) is not available on the PATH
|
685
|
+
you can manually specify it's location by setting
|
686
|
+
`dependencies/minimagick/cli_path`. For example:
|
687
|
+
|
688
|
+
```yaml
|
689
|
+
dependencies:
|
690
|
+
minimagick:
|
691
|
+
cli_path: '/usr/bin/convert'
|
692
|
+
```
|
693
|
+
|
654
694
|
#### Workers and Threads
|
655
695
|
|
656
696
|
In order to achieve maximum utilization of all processors on a computer during
|
data/TODO.md
CHANGED
@@ -2,12 +2,8 @@
|
|
2
2
|
|
3
3
|
## In Progress
|
4
4
|
|
5
|
-
1. Create config to configure mini magick
|
6
|
-
(http://www.rubydoc.info/github/minimagick/minimagick/MiniMagick/Configuration)
|
7
5
|
1. Create config to configure mini exiftool, also invalid chars
|
8
6
|
(https://github.com/janfri/mini_exiftool#configuration)
|
9
|
-
1. Configure releases from travis-ci
|
10
|
-
(https://docs.travis-ci.com/user/deployment/rubygems)
|
11
7
|
1. Consider adding after release step of bumping and pushing other projects
|
12
8
|
(https://docs.travis-ci.com/user/deployment/custom/)
|
13
9
|
|
@@ -19,12 +19,26 @@ module Photish
|
|
19
19
|
plugins: [],
|
20
20
|
image_extensions: image_extensions,
|
21
21
|
page_extension: 'slim',
|
22
|
-
soft_failure: false
|
22
|
+
soft_failure: false,
|
23
|
+
dependencies: {
|
24
|
+
minimagick: minimagick
|
25
|
+
}
|
23
26
|
}
|
24
27
|
end
|
25
28
|
|
26
29
|
private
|
27
30
|
|
31
|
+
def minimagick
|
32
|
+
{
|
33
|
+
cli: 'imagemagick',
|
34
|
+
cli_path: nil,
|
35
|
+
timeout: 3600,
|
36
|
+
validate_on_create: true,
|
37
|
+
validate_on_write: true,
|
38
|
+
whiny: true
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
28
42
|
def image_extensions
|
29
43
|
['aai', 'art', 'avs', 'bgr', 'bgra', 'bgro', 'bmp', 'bmp2', 'bmp3', 'brf', 'cal', 'cals', 'canvas', 'caption', 'cin', 'cip', 'clip', 'cmyk', 'cmyka', 'cur', 'cut', 'data', 'dcm', 'dcx', 'dds', 'dfont', 'dpx', 'dxt1', 'dxt5', 'eps2', 'eps3', 'fax', 'fits', 'fractal', 'fts', 'g3', 'gif', 'gif87', 'gradient', 'gray', 'group4', 'h', 'hald', 'hdr', 'histogram', 'hrz', 'htm', 'html', 'icb', 'ico', 'icon', 'inline', 'ipl', 'isobrl', 'isobrl6', 'jng', 'jnx', 'jpe', 'jpeg', 'jpg', 'jps', 'label', 'mac', 'magick', 'map', 'mask', 'matte', 'miff', 'mng', 'mono', 'mpc', 'msl', 'mtv', 'mvg', 'null', 'otb', 'otf', 'pal', 'palm', 'pam', 'pango', 'pattern', 'pbm', 'pcd', 'pcds', 'pct', 'pcx', 'pdb', 'pes', 'pfa', 'pfb', 'pfm', 'pgm', 'picon', 'pict', 'pix', 'pjpeg', 'plasma', 'png', 'png00', 'png24', 'png32', 'png48', 'png64', 'png8', 'pnm', 'ppm', 'preview', 'ps2', 'ps3', 'psb', 'psd', 'ptif', 'pwp', 'radial-gradient', 'ras', 'rgb', 'rgba', 'rgbo', 'rgf', 'rla', 'rle', 'scr', 'sct', 'sfw', 'sgi', 'shtml', 'six', 'sixel', 'sparse-color', 'stegano', 'sun', 'text', 'tga', 'thumbnail', 'tiff', 'tiff64', 'tile', 'tim', 'ttc', 'ttf', 'ubrl', 'ubrl6', 'uil', 'uyvy', 'vda', 'vicar', 'vid', 'viff', 'vips', 'vst', 'wbmp', 'wpg', 'xbm', 'xc', 'xcf', 'xpm', 'xv', 'ycbcr', 'ycbcra', 'yuv']
|
30
44
|
end
|
data/lib/photish/render/image.rb
CHANGED
@@ -11,6 +11,7 @@ module Photish
|
|
11
11
|
def render(images)
|
12
12
|
log.debug "Rendering #{images.count} images across #{threads} threads"
|
13
13
|
|
14
|
+
setup_minimagick
|
14
15
|
cache_load_from_disk
|
15
16
|
threads = spawn_thread_instances(to_queue(images))
|
16
17
|
threads.map(&:join)
|
@@ -80,7 +81,6 @@ module Photish
|
|
80
81
|
convert << image.path
|
81
82
|
convert.merge!(image.quality_params)
|
82
83
|
convert << output_path(image)
|
83
|
-
log.debug "Performing image conversion #{convert.command}"
|
84
84
|
end
|
85
85
|
rescue MiniMagick::Error => e
|
86
86
|
log.warn "Error occured while converting"
|
@@ -102,6 +102,27 @@ module Photish
|
|
102
102
|
worker_index,
|
103
103
|
version_hash)
|
104
104
|
end
|
105
|
+
|
106
|
+
def minimagick_config
|
107
|
+
config.dependencies.minimagick
|
108
|
+
end
|
109
|
+
|
110
|
+
def debug?
|
111
|
+
config.logging.level == 'debug'
|
112
|
+
end
|
113
|
+
|
114
|
+
def setup_minimagick
|
115
|
+
MiniMagick.configure do |config|
|
116
|
+
config.cli = minimagick_config.cli.to_sym
|
117
|
+
config.cli_path = minimagick_config.cli_path if minimagick_config.cli_path
|
118
|
+
config.debug = debug?
|
119
|
+
config.logger = MiniMagick::Logger.new(Log::IO.new(log, :debug))
|
120
|
+
config.timeout = minimagick_config.timeout
|
121
|
+
config.validate_on_create = minimagick_config.validate_on_create
|
122
|
+
config.validate_on_write = minimagick_config.validate_on_write
|
123
|
+
config.whiny = minimagick_config.whiny
|
124
|
+
end
|
125
|
+
end
|
105
126
|
end
|
106
127
|
end
|
107
128
|
end
|
data/lib/photish/version.rb
CHANGED