file_pipeline 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 322625abd230234c894c2301fd0e0c1b3796468990a5afaecce49420bc6867f9
|
4
|
+
data.tar.gz: 24d827592c3d395b26b60091197c03eb066a5692515756d9e626c43b7d900df8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0e4a5ab15d7e2249eef4bafb01c7aa4ddc1c1781e7f916992f06859497d1a61309157d9fc46a271cea13b226f3abeb10bc787914bcda4fe2ecfb3d0ac8900ed
|
7
|
+
data.tar.gz: e232e47c1870c5e01a884bcaf3ba0caf7ad0151e310222a1bc3adbdb7ac0a3203f29d34901fb642fc8f4b85f014d4f9f66d18d82e6517688ff723b7110766ee5
|
data/README.rdoc
CHANGED
@@ -132,7 +132,7 @@ the same directory as the original file. The working directory will have the
|
|
132
132
|
name of the file basename without extension and the suffix <tt>'_versions'</tt>
|
133
133
|
added.
|
134
134
|
|
135
|
-
Pipelines can be applied to a singe versioned file with
|
135
|
+
Pipelines can be applied to a singe versioned file with
|
136
136
|
the {#apply_to}[rdoc-ref:FilePipeline::Pipeline#apply_to] method of the pipeline
|
137
137
|
instance, or to an array of versioned files with the
|
138
138
|
{#batch_apply}[rdoc-ref:FilePipeline::Pipeline#batch_apply] method of the
|
@@ -181,24 +181,26 @@ exif tags and their values as captured data.
|
|
181
181
|
|
182
182
|
The
|
183
183
|
{#recovered_metadata}[rdoc-ref:FilePipeline::VersionedFile#recovered_metadata]
|
184
|
-
of the versioned file instance will return a hash with all metadata that
|
185
|
-
|
184
|
+
of the versioned file instance will return a hash with all metadata that could
|
185
|
+
not be restored:
|
186
186
|
|
187
187
|
delete_tags = ['CreatorTool', 'Software']
|
188
188
|
|
189
189
|
my_pipeline = FilePipeline::Pipeline.new do |pipeline|
|
190
190
|
pipeline.define_operation('scale', width: 1280, height: 1024)
|
191
191
|
pipeline.define_operation('exif_restoration')
|
192
|
-
Pipeline.define_operation('exif_redaction', :redact_tags => delete_tags)
|
193
192
|
end
|
194
193
|
|
195
194
|
image = FilePipeline::VersionedFile.new('~/image.jpg')
|
196
195
|
my_pipeline.apply_to(image)
|
197
196
|
|
197
|
+
# return metadata that could not be restored
|
198
198
|
image.recovered_metadata
|
199
199
|
|
200
|
-
|
201
|
-
|
200
|
+
This method will _not_ return data that was intentionally deleted with e.g. the
|
201
|
+
{ExifRedaction}[rdoc-ref:FilePipeline::FileOperations::ExifRedaction] file
|
202
|
+
operation. For information on retrieving that, or other kinds of captured data,
|
203
|
+
refer to the versioned file instance methods
|
202
204
|
{#captured_data}[rdoc-ref:FilePipeline::VersionedFile#captured_data],
|
203
205
|
{#captured_data_for}[rdoc-ref:FilePipeline::VersionedFile#captured_data_for],
|
204
206
|
and
|
@@ -11,6 +11,10 @@ module FilePipeline
|
|
11
11
|
# Tag for operations that return _Exif_ metadata that has not been
|
12
12
|
# preserved (by accident or intention) in a file.
|
13
13
|
DROPPED_EXIF_DATA = :dropped_exif_data
|
14
|
+
|
15
|
+
# Tag for operations that return _Exif_ metadata that has been removed
|
16
|
+
# intentionally from a file.
|
17
|
+
REDACTED_EXIF_DATA = :redacted_exif_data
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
@@ -27,13 +27,12 @@ module FilePipeline
|
|
27
27
|
super(opts, defaults)
|
28
28
|
end
|
29
29
|
|
30
|
-
# Returns the
|
30
|
+
# Returns the REDACTED_EXIF_DATA tag defined in CapturedDataTags.
|
31
31
|
#
|
32
|
-
# This operation will capture
|
33
|
-
# declared in #options <tt>redact_tags</tt
|
34
|
-
# file created by the operation.
|
32
|
+
# This operation will capture _Exif_ tags and their values for any tags
|
33
|
+
# declared in #options <tt>redact_tags</tt>.
|
35
34
|
def captured_data_tag
|
36
|
-
CapturedDataTags::
|
35
|
+
CapturedDataTags::REDACTED_EXIF_DATA
|
37
36
|
end
|
38
37
|
|
39
38
|
# :args: src_file, out_file
|
@@ -106,11 +106,8 @@ module FilePipeline
|
|
106
106
|
def captured_data_with(tag)
|
107
107
|
return unless changed?
|
108
108
|
|
109
|
-
captured_data.
|
110
|
-
|
111
|
-
|
112
|
-
results
|
113
|
-
end
|
109
|
+
captured_data.select { |operation, _| operation.captured_data_tag == tag }
|
110
|
+
.map(&:last)
|
114
111
|
end
|
115
112
|
|
116
113
|
# Returns +true+ if there are #versions (file has been modified).
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Stein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_exiftool
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.0.
|
33
|
+
version: 2.0.16
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.0.
|
40
|
+
version: 2.0.16
|
41
41
|
description: The file_pipeline gem provides a framework fornondestructive application
|
42
42
|
of file operation batches to files.
|
43
43
|
email: loveablelobster@fastmail.fm
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
|
-
rubygems_version: 3.0.
|
87
|
+
rubygems_version: 3.0.6
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: Nondestructive file processing with a defined batch
|