module ApplicationHelper

  def wicked_pdf_image_tag_for_public(img, options={})
    if img
      img_medium = img.insert(9, 'medium_')
      new_image = img_medium.to_s.slice(1..-1)
      image_tag "file://#{Rails.root.join('public', new_image.to_s)}", options
    end
  end

  def wicked_pdf_barcode_image(img, options)
    image_tag "file://#{Rails.root.join('public', 'barcodes', img)}", options
  end

  def wicked_pdf_image_tag_invoice(img, options = {})
    image_tag "file://#{Rails.root.join('public', 'images', img)}", options
  end

  def wicked_pdf_image_tag_qr(img, options = {})
    image_tag "file://#{Rails.root.join('public', img)}", options
  end
end
