lib/hydra/derivatives/jpeg2k_image.rb in hydra-derivatives-1.0.0.rc1 vs lib/hydra/derivatives/jpeg2k_image.rb in hydra-derivatives-1.0.0
- old
+ new
@@ -23,20 +23,20 @@
encode_file(output_file_name, recipe, file_path: file_path)
File.unlink(file_path) unless file_path.nil?
end
end
- def encode_file(dest_dsid, recipe, opts={})
+ def encode_file(dest_path, recipe, opts={})
output_file = self.class.tmp_file('.jp2')
if opts[:file_path]
self.class.encode(opts[:file_path], recipe, output_file)
else
source_file.to_tempfile do |f|
self.class.encode(f.path, recipe, output_file)
end
end
out_file = File.open(output_file, "rb")
- object.add_file_datastream(out_file.read, dsid: dest_dsid, mime_type: 'image/jp2')
+ object.add_file(out_file.read, path: dest_path, mime_type: 'image/jp2')
File.unlink(output_file)
end
protected
def preprocess(image, opts={})