lib/ddr/derivatives/multires_image.rb in ddr-models-3.0.0.rc6 vs lib/ddr/derivatives/multires_image.rb in ddr-models-3.0.0
- old
+ new
@@ -21,10 +21,15 @@
def output_path(object)
File.join(create_external_file_path!, output_file_name(object))
end
def output_file_name(object)
- basename = object.content.original_name.present? ? File.basename(object.content.original_name, '.*') : "multires_image"
+ basename = if object.content.original_name.present?
+ bname = File.basename(object.content.original_name, '.*')
+ Ddr::Utils.sanitize_filename(bname)
+ else
+ "multires_image"
+ end
"#{basename}.#{generator.class.output_extension}"
end
def store(object, output_path)
object.multires_image_file_path = output_path