[புதன் ஜூன் 05, 2024] Juergen Fenn wrote: > Am 03.06.24 um 07:06 Uhr schrieb Visuwesh: >> [ஞாயிறு ஜூன் 02, 2024] Juergen Fenn wrote: >>> [...] >>> I'm afraid I forgot to mention that I don't get prompted, and I did not >>> copy the image from my webbrowser. Rather, I downloaded the jpg file >>> over Europeana's proxy from Finnish National Library and then copied >>> this one with Command-c in Finder (the macOS file manager) from local >>> system SSD. I do not understand how the tiff comes in here. But is is >>> there in the data folder Org created. I tried to open it in Preview, I >>> even changed the file ending to .jpg, but I cannot open it. The tiff >>> file seems to be corrupt. >>> >> >> Please tell what is shown in the *Completions* buffer when you do M-x >> yank-media-types RET after you copy the image to the clipboard. I >> suspect the problem is with the regexp used to detect the mime-type. >> > > Sorry for my late reply. I have updated to Org 9.7.2 in the meanwhile. > > M-x yank-media-types RET yields: > > Yank type: > clipboard:image/tiff > clipboard:STRING > clipboard:text/plain
I'm afraid there's nothing much we can do. IIUC, you copy the file from a file manager, so Org expects clipboard to be something like Possible completions are: clipboard:x-special/gnome-copied-files primary:... where clipboard:x-special/gnome-copied-files gives copy file:///home/viz/tmp/2-gnus_stipple.png but given there's neither image/jpeg nor a special type like the above, Org's yank-media copies the image/tiff data (the regexp used by Org looks for mime-types that match the regexp "image/.*"). I am guessing clipboard:text/plain contains the link to the file, am I right? But this feels fragile to rely on. What happens when you copy multiple images to the clipboard from the file manager? Is there a difference in yank-media-types' output? What if you copy a non-image file to the clipboard? Say a PDF file. I don't have access to a Mac but if you can find documentation on how Finder puts the relevant data in the clipboard, that would be useful. [ In Linux, you expect the x-special/gnome-copied-files or somesuch TARGET. ] BTW, we might have similar problems in Windows too. See this thread in emacs-devel when yank-media was initially added: https://yhetil.org/emacs-devel/837ddk9tc8....@gnu.org > M-x yank-media RET still inserts an attachment with a tiff file that I > cannot open in Preview. Given the above, I hope you understand why this happens. HTH.