metaclean 4.2.0 → 4.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e4ebafb7621f428c5a0d0040c2487340e2dd22b32b831bf47c957027e4d0ca9
4
- data.tar.gz: e9420536e480b319833996372e9d679285289e5afdfe3555466ff8167ebf5d7f
3
+ metadata.gz: c428b3f2958e89cf07a3cc42602ec6f4716cc30cd7d83ca248830f46884a38a6
4
+ data.tar.gz: b9e573fb8bf73fd0a593ad251d7f38109a38b4c45544774e3f7176d389968bc3
5
5
  SHA512:
6
- metadata.gz: 6c9b8b897058f4b86d9691d53f80f1045d78f1783861048591f6910b92cfca25a1f0e7ee531a91d22144ebf294c1240a4dd46a465412cff7c1d3dcd85d421a4f
7
- data.tar.gz: 5dcdfbd96dd879ddb8c6e86f2c48b29ac43672eb5636ea2fb5e2a3260cac0bf9bad7644bb594d05834e1267850d95034ff3b4780b5a54af9e60b6cc321ea47fd
6
+ metadata.gz: 38c1773439adfceb3903fa989494813995a84f023c7ac7effe9122d3c603896133635fa9c9ba900cdb65f47ee7efaeb28ede85e9543c74b54ea09efcd520fcad
7
+ data.tar.gz: 23a2d419fd75ee953188252b3ba0ea95e27e6f888fd5a26895e267117e77d6b8d9015220bb5d9f1bc58ed18b84d833e3e4c4a7889883601d333e06be4dce1613
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # metaclean
2
2
 
3
- ```
3
+ ```text
4
4
  ███╗ ███╗███████╗████████╗ █████╗ ██████╗██╗ ███████╗ █████╗ ███╗ ██╗
5
5
  ████╗ ████║██╔════╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔════╝██╔══██╗████╗ ██║
6
6
  ██╔████╔██║█████╗ ██║ ███████║██║ ██║ █████╗ ███████║██╔██╗ ██║
@@ -253,6 +253,9 @@ git push origin vX.Y.Z
253
253
  unverified candidates all exit non-zero.
254
254
  - When stdout is redirected, metadata values are redacted by default. Use
255
255
  `--show-values` only when the destination log is trusted.
256
+ - Warnings and errors are written to stderr, so privacy notes (surviving tags,
257
+ the `.bak` reminder) stay visible even when normal output is piped or sent
258
+ to a file.
256
259
  - External tool versions are recorded in CI and shown by `metaclean --version`.
257
260
  Keep OS packages updated; release tests exercise the supported Ruby range and
258
261
  capability-check qpdf/ffmpeg output rather than trusting version strings.
data/SECURITY.md CHANGED
@@ -46,7 +46,10 @@ clean while such metadata survives is a security issue.
46
46
 
47
47
  A non-standard ICC profile (one whose description is not a recognized standard
48
48
  color space) blocks commit unless the user explicitly accepts its identifying
49
- fields with `--allow-icc-metadata`; standard color spaces clean without it.
49
+ fields with `--allow-icc-metadata`; standard color spaces clean without it. This
50
+ determination trusts the profile's own `ProfileDescription`: a profile whose
51
+ description matches a recognized color space is treated as non-identifying, so
52
+ its remaining ICC fields are not flagged.
50
53
 
51
54
  ## Supported versions
52
55
 
data/lib/metaclean/cli.rb CHANGED
@@ -25,7 +25,6 @@ module Metaclean
25
25
 
26
26
  def run
27
27
  parse!
28
- Display.configure(quiet: @options[:quiet], redact_values: @options[:redact_values])
29
28
  Metaclean.ensure_tools!(in_place: @options[:in_place])
30
29
  runner = Runner.new(@options)
31
30
  if @options[:inspect_only]
@@ -104,8 +103,8 @@ module Metaclean
104
103
 
105
104
  o.separator ''
106
105
  o.separator 'Other:'
107
- o.on('-h', '--help') { Display.banner; puts o; exit }
108
- o.on('-v', '--version') do
106
+ o.on('-h', '--help', 'Show this help and exit') { Display.banner; puts o; exit }
107
+ o.on('-v', '--version', 'Show metaclean and tool versions, then exit') do
109
108
  Display.banner
110
109
  puts "metaclean #{Metaclean::VERSION}"
111
110
  puts " exiftool: #{Display.printable(Exiftool.version || 'not found')}"
@@ -43,10 +43,13 @@ module Metaclean
43
43
  def color?
44
44
  return @color if defined?(@color)
45
45
 
46
- no_color = ENV['NO_COLOR'].to_s
47
- @color = $stdout.tty? && no_color.empty?
48
- @color = true if ENV['FORCE_COLOR']
49
- @color
46
+ @color = if !ENV['NO_COLOR'].to_s.empty?
47
+ false
48
+ elsif !ENV['FORCE_COLOR'].to_s.empty?
49
+ true
50
+ else
51
+ $stdout.tty?
52
+ end
50
53
  end
51
54
 
52
55
  def c(text, color)
@@ -73,7 +76,7 @@ module Metaclean
73
76
  def section(text); puts c("▸ #{text}", :cyan) unless quiet?; end
74
77
  def info(text); puts c(" #{text}", :gray) unless quiet?; end
75
78
  def success(text); puts c("✓ #{text}", :green) unless quiet?; end
76
- def warning(text); puts c("⚠ #{text}", :yellow);end
79
+ def warning(text); warn c("⚠ #{text}", :yellow);end
77
80
 
78
81
  def error(text); c("✗ #{text}", :red); end
79
82
 
@@ -159,9 +159,12 @@ module Metaclean
159
159
  Display.warning "Privacy-relevant tags still present (#{residual.size}):"
160
160
  unless Display.quiet?
161
161
  residual.each do |key, value|
162
- puts " #{Display.c(key, :yellow)} = #{Display.truncate(Display.visible_value(value), 60)}"
162
+ warn " #{Display.c(key, :yellow)} = #{Display.truncate(Display.visible_value(value), 60)}"
163
163
  end
164
164
  end
165
+ if residual.keys.all? { |key| key.to_s.start_with?('ICC') }
166
+ Display.warning 'Only ICC profile text remains — review it and pass --allow-icc-metadata to accept it.'
167
+ end
165
168
  residual
166
169
  end
167
170
 
@@ -296,7 +299,7 @@ module Metaclean
296
299
  if summary[:unsupported].positive?
297
300
  Display.warning "Unsupported (not cleaned): #{summary[:unsupported]} file(s)"
298
301
  end
299
- puts Display.error("Failed: #{summary[:failed]}") if summary[:failed].positive?
302
+ warn Display.error("Failed: #{summary[:failed]}") if summary[:failed].positive?
300
303
  Display.info "Total embedded tags removed: #{summary[:removed_total]}"
301
304
  if summary[:residual_files].positive?
302
305
  Display.warning "Files with privacy residual: #{summary[:residual_files]}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Metaclean
4
- VERSION = '4.2.0'
4
+ VERSION = '4.3.1'
5
5
  end
data/lib/metaclean.rb CHANGED
@@ -118,7 +118,7 @@ module Metaclean
118
118
  missing << 'exiftool' unless Exiftool.available?
119
119
  missing << 'mat2' unless Mat2.available?
120
120
  missing << 'qpdf' unless Qpdf.available?
121
- missing << 'ffmpeg' unless Ffmpeg.available?
121
+ missing << 'ffmpeg (with ffprobe)' unless Ffmpeg.available?
122
122
  missing << 'cp with metadata preservation' if in_place && !FileOps.metadata_copy_supported?
123
123
  return if missing.empty?
124
124
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metaclean
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Zogaj
@@ -42,6 +42,7 @@ licenses:
42
42
  metadata:
43
43
  allowed_push_host: https://rubygems.org
44
44
  bug_tracker_uri: https://github.com/26zl/metaclean/issues
45
+ changelog_uri: https://github.com/26zl/metaclean/releases
45
46
  documentation_uri: https://github.com/26zl/metaclean#readme
46
47
  source_code_uri: https://github.com/26zl/metaclean
47
48
  rubygems_mfa_required: 'true'