retouch 0.3.1 → 0.3.2
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 +4 -4
- data/.codespellignore +0 -0
- data/.yamllint +16 -0
- data/CHANGELOG.md +6 -3
- data/lib/retouch/batch.rb +17 -1
- data/lib/retouch/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 31384107f186fa5f161afcc5ad8037cbb328c8989768f6baa38d689a4be0e6f9
|
|
4
|
+
data.tar.gz: 1001ee8463fed9e436aff8e72099f2790b0428203dd57a27db58081dae1a8cac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 845b4b9b951220cd4997743d1eaf6a69aebae86f57117f8c2e9684a55414a5ce165faee90bc7ffecf36f0d427388e501fe5d60aec892e01e8787631849b191e8
|
|
7
|
+
data.tar.gz: 2c4d4b2ad3ca84479d6d686594a42cfa90fdd0937adf2a506da2ce7e420fb3ddbeb2bc8a4cc77c19d2d27c8e0d47f7fc4b53e2c5c82aab5a90269a4b2c39b183
|
data/.codespellignore
ADDED
|
File without changes
|
data/.yamllint
ADDED
data/CHANGELOG.md
CHANGED
|
@@ -2,17 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Retouch are recorded here.
|
|
4
4
|
|
|
5
|
+
## [0.3.2] - 2026-09-26
|
|
6
|
+
|
|
7
|
+
- Reject batch outputs that resolve to the same file through symlinks or hard links.
|
|
8
|
+
|
|
5
9
|
## [0.3.1] - 2026-09-25
|
|
6
10
|
|
|
7
|
-
-
|
|
8
|
-
- Require Flipbook 0.4.0 for GIF and APNG
|
|
11
|
+
- Preserve colors and transparency more consistently when resizing images.
|
|
12
|
+
- Require Flipbook 0.4.0 for GIF and APNG support.
|
|
9
13
|
|
|
10
14
|
## [0.3.0] - 2026-09-25
|
|
11
15
|
|
|
12
16
|
- Add color, quantization, convolution, pixelation, compositing, annotation, and multi-image operations.
|
|
13
17
|
- Add glob-based batch transforms, output templates, and process workers.
|
|
14
18
|
- Add optional Glyphic text and Flipbook 0.3.0+ GIF reading, GIF output, and APNG output integrations.
|
|
15
|
-
- Document current format and GIF Reader limitations.
|
|
16
19
|
|
|
17
20
|
## [0.1.0] - 2026-09-25
|
|
18
21
|
|
data/lib/retouch/batch.rb
CHANGED
|
@@ -29,7 +29,8 @@ module Retouch
|
|
|
29
29
|
raise Error, "input file does not exist: #{paths.find { |path| !File.file?(path) }}" unless paths.all? { |path| File.file?(path) }
|
|
30
30
|
|
|
31
31
|
outputs = paths.each_with_index.map { |path, index| output_path(to, path, index) }
|
|
32
|
-
|
|
32
|
+
resolved_outputs = outputs.map { |path| destination_key(path) }
|
|
33
|
+
raise Error, "output template produces duplicate paths" unless resolved_outputs.uniq.length == outputs.length
|
|
33
34
|
|
|
34
35
|
jobs = Integer(jobs)
|
|
35
36
|
raise ArgumentError, "jobs must be positive" unless jobs.positive?
|
|
@@ -67,6 +68,21 @@ module Retouch
|
|
|
67
68
|
|
|
68
69
|
outputs
|
|
69
70
|
end
|
|
71
|
+
|
|
72
|
+
def self.destination_key(path)
|
|
73
|
+
ancestor = File.expand_path(path)
|
|
74
|
+
suffix = []
|
|
75
|
+
until File.exist?(ancestor) || File.symlink?(ancestor)
|
|
76
|
+
suffix.unshift(File.basename(ancestor))
|
|
77
|
+
ancestor = File.dirname(ancestor)
|
|
78
|
+
end
|
|
79
|
+
resolved = File.join(File.realpath(ancestor), *suffix)
|
|
80
|
+
return resolved unless File.file?(resolved)
|
|
81
|
+
|
|
82
|
+
stat = File.stat(resolved)
|
|
83
|
+
[stat.dev, stat.ino]
|
|
84
|
+
end
|
|
85
|
+
private_class_method :destination_key
|
|
70
86
|
end
|
|
71
87
|
|
|
72
88
|
def self.batch(inputs, to:, jobs: 1, force: false, &block)
|
data/lib/retouch/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: retouch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yudai Takada
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: tessel
|
|
@@ -109,7 +109,9 @@ executables:
|
|
|
109
109
|
extensions: []
|
|
110
110
|
extra_rdoc_files: []
|
|
111
111
|
files:
|
|
112
|
+
- ".codespellignore"
|
|
112
113
|
- ".rubocop.yml"
|
|
114
|
+
- ".yamllint"
|
|
113
115
|
- CHANGELOG.md
|
|
114
116
|
- LICENSE
|
|
115
117
|
- README.md
|