Sha256: b26b66a2b949f8203a3596682d171a58272d6313bd36f3c2255fe964666098a0
Contents?: true
Size: 862 Bytes
Versions: 1
Compression:
Stored size: 862 Bytes
Contents
require 'hydra-file_characterization' require 'mime/types' module Hydra module Derivatives module ExtractMetadata def extract_metadata return unless has_content? Hydra::FileCharacterization.characterize(content, filename_for_characterization.join(""), :fits) do |config| config[:fits] = Hydra::Derivatives.fits_path end end protected def filename_for_characterization registered_mime_type = MIME::Types[mime_type].first Logger.warn "Unable to find a registered mime type for #{mime_type.inspect} on #{uri}" unless registered_mime_type extension = registered_mime_type ? ".#{registered_mime_type.extensions.first}" : '' version_id = 1 # TODO fixme m = /\/([^\/]*)$/.match(uri) ["#{m[1]}-#{version_id}", "#{extension}"] end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hydra-derivatives-2.0.0 | lib/hydra/derivatives/extract_metadata.rb |