Sha256: 6692f87accf7e214b45f0def31b7493274e1225b6f5db47f4b620f565dca57ad

Contents?: true

Size: 875 Bytes

Versions: 9

Compression:

Stored size: 875 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true
# encoding: UTF-8
# (c) ANB Andrew Bizyaev

require_relative '_tag_array_of_strings'

module ExifTagger
  module Tag
    # MWG:Keywords, string[0,64]+, List of Strings
    #   IPTC:Keywords, XMP-dc:Subject
    # exiftool types:
    #   Keywords = Array ["aaa", "bbb"] OR String "aaa"
    #   Subject = Array ["aaa", "bbb"] OR String "aaa"

    class Keywords < TagArrayOfStrings
      MAX_BYTESIZE = 64
      EXIFTOOL_TAGS = %w(Keywords Subject).freeze

      private

      def validate_vs_previous
        @warnings = []
        @warnings.freeze
      end

      def generate_write_script_lines
        @value.each do |o|
          unless Tag.empty?(o)
            @write_script_lines << %(-MWG:Keywords-=#{o})
            @write_script_lines << %(-MWG:Keywords+=#{o})
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
phtools-0.18.0 lib/phtools/exif_tagger/tags/keywords.rb
phtools-0.17.0 lib/phtools/exif_tagger/tags/keywords.rb
phtools-0.16.1 lib/phtools/exif_tagger/tags/keywords.rb
phtools-0.16.0 lib/phtools/exif_tagger/tags/keywords.rb
phtools-0.15.1 lib/phtools/exif_tagger/tags/keywords.rb
phtools-0.15.0 lib/phtools/exif_tagger/tags/keywords.rb
phtools-0.14.0 lib/phtools/exif_tagger/tags/keywords.rb
phtools-0.11.2 lib/phtools/exif_tagger/tags/keywords.rb
phtools-0.11.1 lib/phtools/exif_tagger/tags/keywords.rb