Unable to attach screenshot images in macOS 14.0 when Wikilinks turned off (urlencode (U+202F) char)

Steps to reproduce

This only happens on the new macOS 14.0. Works fine on 13.x.

  1. Turn off “Use Wikilinks” in the settings
  2. Take a screenshot with Cmd-Shift-4
  3. Drag the image into Obsidian editor page

If I rename the screenshot image to like “foo.png” then it works fine. It seems that something particular about the screenshot filename causing this problem.

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

Should see the image in the editor:

Actual result

The image cannot be shown:

Environment

MacOS Sonoma 14.0
Obsidian Version 1.4.14 (Installer 1.4.13)


Additional information

1 Like

can you post a screen recording of this happening in the sandbox vault?

Here you go:

What is the filename exactly?
Is there some weird space right before PM?!?

something like “Screenshot 2023-10-05 at 5.07.05 PM.png”. That’s the standard macOS screenshot filename.

I have to emphasize that it works on macOS 13.x but not on 14.0. The filename looks the same, though.

I just found out that if I replace the spaces in the filename to something else, the image can be imported correctly. Please fix this.

Steps to reproduce

The U+202F is used in file name captured by macOS standard screenshot tool for macOS 14.0 and above. To reproduce:

  1. Take a screenshot with Cmd-Shift-4
  2. Turn off “Use Wikilinks” in the Obsidian settings
  3. Drag the image into Obsidian editor page

The screeenshot file name uses ‘NARROW NO-BREAK SPACE’ (U+202F,or  ) instead of the space character between the time and ‘AM/PM’. This prevents the file from attaching to Obsidian. Remove that character and the file can be imported correctly.

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

Should see the image in the editor.

Actual result

The image cannot be shown.

Environment

MacOS Sonoma 14.1.1
Obsidian Version 1.4.16 (Installer 1.4.13)

Additional information

I reported this bug 2 months ago Here but the bug is still here. The cause of the bug is clear and should be an easy fix. Please fix it.

1 Like

Seconded this bug is still present

Steps to reproduce

Problem:
I stumbled upon a glitch where screenshots created after 2023-12-31 (or possibly after my OS upgrade?) were not recognized in Obsidian markdown mode. When pasted, the screenshot is copied to the attachments/assets folder but the note cannot find it. I get an error message, that says the image cannot be found.

Looking closely at the link, I see it was improperly converted to markdown mode, such that the last space before the ‘PM’ time stamp missed replacing the space with %20; However, editing that mistake manually in Obsidian doesn’t work; it has to be edited in Finder: if I edit the file name in Finder before pasting, it works. Otherwise “image couldn’t be found.”

Not an issue if the file does not contain the date; actually it seems to be the PM or AM in the date. Very strange, but if I rename the file in finder, such that if I remove the PM, it works. Pastes perfectly. IN FACT, I can even delete the PM and manually put it back, save the file, and then paste it into the Obsidian note and it will work, EVEN THOUGH (in Finder) the filenames are identical. ALSO, both of those files (the original and the renamed file) can have the identical name in finder! They can co-exist at the same time, same folder, with the same name. So MacOS is introducing something into the name that is causing a problem in markdown in Obsidian.

Oh, and WikiLinks mode has no difficulty with the same screenshots. If I start in WikiLinks mode, then convert the page to markdown, then Obsidian cannot find the file. Or if I’m in markdown mode when I paste the file, same.

This note details the problem in depth: Glitch: images cannot be found error in markdown - #3 by Tesgin

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

When I paste a screenshot image I expect a copy of the image to appear in the assets folder, and then to be able to see the image in the note.

Actual result

A copy of the image appears in the assets folder, but the image does not appear in the note; instead I get an error message (e.g., “Assets/Screenshot 2024-01-04 at 1.11.16PM 1.png” could not be found).

Environment

SYSTEM INFO:
Obsidian version: v1.5.3
Installer version: v1.4.16
Operating system: Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 23.2.0
Login status: not logged in
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information


Never solved this problem. It is a clear glitch that for some unknown reason, Obsidian markdown mode has problems with images with a timestamp that contains AM or PM. Very odd.

My workaround: I tweaked my screenshots (in terminal) so they default to jpg instead of PNG; I also tweaked MacOS preferences to use military time instead of U.S AM/PM. Problems go away.

My upload includes two screenshots with identical names. I can see that both appear as a visible screenshot. If I past those into Obsidian, one will appear, one will get the error message.

I am on latest version of Obsidian. I just updated my MacOS to Sonoma 14.2.1 (23C71).

I would link to your other post so people are aware of what troubleshooting steps you have tried. They can look at that thread too.

Certainly. Actually the link is there but several paragraphs down, and it’s a lengthy post.

Here’s the link to the more detailed post: Glitch: images cannot be found error in markdown

IDK if this is helpful, but a little more info about the filename thing, 'cuz it clearly seems to have something to do with that …

I can take the “bad file” (the one that won’t paste) and make a duplicate in Finder. So, a sample screenshot is named, ‘Screenshot 2024-01-04 at 1.11.16 PM.png’ and now there’s a second file with the same name, appendaged with the word, ‘Copy’. I change the name of the duplicate file, replacing ‘.png COPY’ at the end with ‘.png’, and save it. Now the file has the SAME EXACT filename as the original “bad file.” Side-by-side in Finder, same folder, same name, which makes no sense. That second, “re-named” file will now paste properly in Obsidian, with no errors.

So I’m no expert on these things, and it makes no sense to me, but it would seem that the name created when the screenshot is created must have some invisible attribute or characteristic that is not the same as when I manually rename the copy. There’s something different in the name – something not visible – which allows the two files with “seemingly” identical names to coexist in the same folder. And the only letters that I changed are the PM or AM on the timestamp. And that new, renamed file “works” in Obsidian. So there’s something in that original filename that Obsidian doesn’t like.

This is a suboptimal work around but you can turn off the date function in the screenshot with the following command in Terminal “defaults write com.apple.screencapture “include-date” 0”

will be fixed 1.5.5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.