{"id":21291699,"url":"https://github.com/jdtsmith/org-mac-image-paste","last_synced_at":"2025-07-28T21:08:57.471Z","repository":{"id":66869999,"uuid":"468858659","full_name":"jdtsmith/org-mac-image-paste","owner":"jdtsmith","description":"Paste images and PDFs directly into org files on emacs-mac. ","archived":false,"fork":false,"pushed_at":"2023-02-09T22:22:15.000Z","size":52,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-15T16:36:15.597Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdtsmith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-11T18:25:24.000Z","updated_at":"2024-12-15T04:10:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"096582cf-ef4f-45e7-82d8-dcfbb96f601a","html_url":"https://github.com/jdtsmith/org-mac-image-paste","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jdtsmith/org-mac-image-paste","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdtsmith%2Forg-mac-image-paste","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdtsmith%2Forg-mac-image-paste/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdtsmith%2Forg-mac-image-paste/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdtsmith%2Forg-mac-image-paste/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdtsmith","download_url":"https://codeload.github.com/jdtsmith/org-mac-image-paste/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdtsmith%2Forg-mac-image-paste/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267585808,"owners_count":24111577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T13:39:30.220Z","updated_at":"2025-07-28T21:08:57.443Z","avatar_url":"https://github.com/jdtsmith.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# org-mac-image-paste\nPaste images and cropped PDF clips directly into org files on Mac. \n\nThis simple package enhances org-mode so that images (including\ncropped segments of PDFs) on the clipboard can be _pasted directly\ninto org buffers_, when using emacs-mac.\n\n![omip](https://user-images.githubusercontent.com/93749/158043616-321c4a27-23c3-4ec6-a310-a7183dbe5a73.png)\n\n\n## Features and Details:\n\n- Uses the `image-io` image type, which the emacs-mac fork provides,\n  for very fast display of image/PDF chunks.\n- Uses emacs-mac and applescript to examine the clipboard for image data, saving\n  either a PDF or (via `pngpaste`) a PNG image file to a name like\n  `pasted_graphic...`\n- Uses `org-attach` to _attach_ the pasted images to the containing\n  node.\n- Handles images copied from webpages, which are presented as URLs.\n- Automatically inserts a link at point and views the pasted attachments inline.\n- High-DPI files (with advertised resolution above\n  `omip-high-dpi-limit`) are marked as such with `@2x` in their\n  names, and automatically displayed at 50% scale for the correct size.\n- Cropped PDF files have their cropping information saved in the\n  filename, and are displayed correctly.\n- Provides a convenience function to refresh all inline images in the\n  current node.\n- Also supports file drag-and-drop, with the same features.\n\n## Install and Configuration\n\nNot (yet) available on MELPA.  For now, clone the repo and, e.g.\n\n```elisp\n(use-package org-mac-image-paste\n  :load-path \"~/code/emacs/org-mac-image-paste\" ; or wherever you cloned to\n  :config (org-mac-image-paste-mode 1)\n  :bind (:map org-mode-map (\"\u003cf6\u003e\" . org-mac-image-paste-refresh-this-node)))\n```\n\n## Other Requirements\n\nThe following are necessary for `org-mac-image-paste` to work:\n\n- The excellent [emacs-mac](https://bitbucket.org/mituharu/emacs-mac/) fork of emacs.\n- The in-built `sips` tool (for querying image dpi).\n- `pngpaste` (`brew install pngpaste`), for (quickly) pasting PNG files from the clipboard.\n- `pdfinfo` (`brew install poppler`), for reading crop info from PDF chunks.\n\n## Tips\n\nYou may like to set to set the following org config variables:\n\n```elisp\n(org-use-property-inheritance t) ;Inherit :ID/etc. from parent nodes\n(org-image-actual-width nil)  ;allow #+ATTR_ORG: :width 300 etc. \n(org-attach-id-dir \".org-attach\") ; make the attachment directory less visible\n```\n\nThe inheritance setting allows you to give a top level heading (or even the entire file) an `:ID` (`M-x org-id-get-create`).  Then attachments created at lower levels will all be grouped together under that ID's attachment directory.\n\nIf you prefer an image/PDF to display at a different size, preface it with (e.g.):\n\n```org\n#+ATTR_ORG: :width 600\n```\n\nIf you bind `org-mac-image-paste-refresh-this-node` to a convenient key, you can use it to instantly refresh the inline images of just the containing node, e.g. after you have changed the `:width`.\n\n## Other Thoughts/Future\n\nI wish this package didn't exist. Pasting images and PDF fragments into files is a rather basic capability which many may reasonably expect to \"just work\". I also wish it were fully cross-platform, and didn't rely on external tools to interact with clipboard image data, or determine image resolution and crop information.\n\nBut, AFAICT, there is no means within emacs to query the clipboard for image data.  Note that emacs-mac does present `'image-io` for (most) image data on the clipboard.  \n\nWhat Emacs/Org would need to make this possible:\n\n- Cross-platform clipboard querying of image data and metadata.\n- Automatic handling of high-DPI image data (may be challenging given the different approaches across platforms).\n- Native PDF display, respecting the `CropBox:` parameter.\n\nEmacs 29 already has support for a\n[`yank-media`](https://lars.ingebrigtsen.no/2021/11/08/copying-media-to-emacs/) command, so perhaps this kind of functionality will be coming natively to Org soon.  Imagemagick can handle displaying PDFs inline already.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdtsmith%2Forg-mac-image-paste","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdtsmith%2Forg-mac-image-paste","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdtsmith%2Forg-mac-image-paste/lists"}