After using ObsidianPasteImg a couple of times, it gets into this state where when I paste an image using the command it renders poorly in just Obsidian.
Hard to describe this issue because it seems very specific to Obsidian.
So when I paste the image using ObsidianPasteImg, it shows up in the file tree and everything works as expected, but Obsidian just renders it with some extra brightness and bad contrast. However, when I use finder or preview to open that exact image, it looks perfectly fine, which tells me that this probably isn't an image problem(?), but Obsidian just isn't dealing with it well. The reason I'm submitting an issue here and not to Obsidian though is if I paste the exact same thing I have in my clipboard at the time directly in Obsidian it pastes perfectly fine and the image it adds gets rendered perfectly. Below is an example of first what ObsidianPasteImg's image rendered as, and second what the exact same image pasted from my clipboard shows up as in Obsidian.
Sorry if my explanation wasn't super clear. This seems like a very weird bug to me that I don't understand. Let me know if you want further clarification on anything. I also searched for a while if there were any Obsidian issues out there related to this, but didn't find anything.
Config
{
"epwalsh/obsidian.nvim",
version = false, -- get latest version
lazy = true,
ft = "markdown",
dependencies = {
"nvim-lua/plenary.nvim",
"hrsh7th/nvim-cmp",
"nvim-telescope/telescope.nvim",
"nvim-treesitter/nvim-treesitter",
},
keys = {
{ "<leader>oo", "<cmd>ObsidianOpen<cr>", desc = "Open Obsidian" },
{ "<leader>on", "<cmd>ObsidianNew<cr>", desc = "Create a new Obsidian Document" },
{ "<leader>os", "<cmd>ObsidianSearch<cr>", desc = "Search Obsidian" },
{ "<leader>of", "<cmd>ObsidianQuickSwitch<cr>", desc = "Obsidian Find Files" },
{ "<leader>op", "<cmd>ObsidianPasteImg<cr>", desc = "Obsidian Paste Image" },
{ "<leader>or", "<cmd>ObsidianRename<cr>", desc = "Obsidian Rename current note" },
{ "<leader>ot", "<cmd>ObsidianTemplate<cr>", desc = "Insert Obsidian Template into file" },
},
opts = {
workspaces = {
{
name = "Obsidian Vault",
path = "~/Documents/Obsidian Vault",
},
},
open_app_foreground = true,
completion = {
nvim_cmp = true, -- with this set to true, it automatically configures completion on its own
},
disable_frontmatter = true,
templates = {
subdir = "templates",
date_format = "%Y-%m-%d",
},
note_id_func = function(title)
if title ~= nil then
-- Convert title to lowercase and replace spaces with hyphens, e.g. "My Note" -> "my-note"
return title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
else
return "untitled"
end
end,
},
}
🐛 Describe the bug
After using
ObsidianPasteImg
a couple of times, it gets into this state where when I paste an image using the command it renders poorly in just Obsidian.Hard to describe this issue because it seems very specific to Obsidian.
So when I paste the image using
ObsidianPasteImg
, it shows up in the file tree and everything works as expected, but Obsidian just renders it with some extra brightness and bad contrast. However, when I use finder or preview to open that exact image, it looks perfectly fine, which tells me that this probably isn't an image problem(?), but Obsidian just isn't dealing with it well. The reason I'm submitting an issue here and not to Obsidian though is if I paste the exact same thing I have in my clipboard at the time directly in Obsidian it pastes perfectly fine and the image it adds gets rendered perfectly. Below is an example of first whatObsidianPasteImg
's image rendered as, and second what the exact same image pasted from my clipboard shows up as in Obsidian.I literally just copied this image from google images from this link: https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Instagram_icon.png/480px-Instagram_icon.png
Sorry if my explanation wasn't super clear. This seems like a very weird bug to me that I don't understand. Let me know if you want further clarification on anything. I also searched for a while if there were any Obsidian issues out there related to this, but didn't find anything.
Config
Environment
Obsidian v1.5.8 (Installer version v1.4.16)