# File lib/juicer/image_embed.rb, line 87
    def embed_data_uri( path )
      new_path = path

      if @force
        supported_file_matches = path.match( /(?:\.)(png|gif|jpg|jpeg)$/i )
      else
        supported_file_matches = path.match( /(?:\.)(png|gif|jpg|jpeg)(?:\?embed=true)$/i )
      end

      filetype = supported_file_matches[1] if supported_file_matches

      if ( filetype )
        filename = path.gsub('?embed=true','')

        # check if file exists, throw an error if it doesn't exist
        if File.exist?( filename )

          # read contents of file into memory
          content = File.open(filename, "rb") { |f| f.read }
          content_type = "image/#{filetype}"

          # encode the url
          new_path = Datafy::make_data_uri( content, content_type )
        else
          puts "Unable to locate file #{filename} on local file system, skipping image embedding"
        end
      end
      return new_path
    end