Skip to content

Commit

Permalink
feat: use process_iamge function when pasting
Browse files Browse the repository at this point in the history
  • Loading branch information
HakonHarnes committed Mar 18, 2024
1 parent 07dd96b commit e4e6b9b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lua/img-clip/paste.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ M.paste_image_from_path = function(src_path, opts)
return false
end

local output, exit_code = fs.process_image(file_path, opts)
if exit_code ~= 0 then
util.warn("Could not process image.", true)
util.warn("Output: " .. output, true)
end

if not markup.insert_markup(file_path) then
util.error("Could not insert markup code.")
return false
Expand Down Expand Up @@ -164,6 +170,12 @@ M.paste_image_from_clipboard = function(opts)
return false
end

local output, exit_code = fs.process_image(file_path, opts)
if exit_code ~= 0 then
util.warn("Could not process image.", true)
util.warn("Output: " .. output, true)
end

if not markup.insert_markup(file_path, opts) then
util.error("Could not insert markup code.")
return false
Expand Down

0 comments on commit e4e6b9b

Please sign in to comment.