Method: IsoDoc::HtmlFunction::Html#move_image1

Defined in:
lib/isodoc/html_function/postprocess.rb

#move_image1(img) ⇒ Object



116
117
118
119
120
121
122
123
124
# File 'lib/isodoc/html_function/postprocess.rb', line 116

def move_image1(img)
  suffix = image_suffix(img)
  uuid = UUIDTools::UUID.random_create.to_s
  fname = "#{uuid}.#{suffix}"
  new_full_filename = File.join(tmpimagedir, fname)
  local_filename = image_localfile(img)
  FileUtils.cp local_filename, new_full_filename
  img["src"] = File.join(rel_tmpimagedir, fname)
end