Attached is a patch that seems to do what you want.  Are you able to try
this?

I'm sure there's a better way to do this but at least this seems to
work.

-- 
: Eric S Fraga, with org release_9.5.4-720-g4db67d in Emacs 29.0.50
From d17d91eb8441876a87e7405de63b3e594bb8ecc6 Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fr...@ucl.ac.uk>
Date: Fri, 12 Aug 2022 12:46:18 +0100
Subject: [PATCH] lisp/ox-beamer: Enable use of overlays for images

* ox-beamer.el (org-beamer-link): If an overlay beamer attributed has
been provided, use it for images.
---
 lisp/ox-beamer.el | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index e6232d8d2..8112b97df 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -734,13 +734,23 @@ used as a communication channel."
   (or (org-export-custom-protocol-maybe link contents 'beamer info)
       ;; Fall-back to LaTeX export.  However, prefer "\hyperlink" over
       ;; "\hyperref" since the former handles overlay specifications.
-      (let ((latex-link (org-export-with-backend 'latex link contents info)))
-	(if (string-match "\\`\\\\hyperref\\[\\(.*?\\)\\]" latex-link)
-	    (replace-match
-	     (format "\\\\hyperlink%s{\\1}"
-		     (or (org-beamer--element-has-overlay-p link) ""))
-	     nil nil latex-link)
-	  latex-link))))
+      (let* ((latex-link (org-export-with-backend 'latex link contents info))
+             (parent (org-export-get-parent-element link))
+             (attr (org-export-read-attribute :attr_beamer parent))
+             (overlay (plist-get attr :overlay)))
+        (cond ((string-match "\\`\\\\hyperref\\[\\(.*?\\)\\]" latex-link)
+	       (replace-match
+	        (format "\\\\hyperlink%s{\\1}"
+		        (or (org-beamer--element-has-overlay-p link) ""))
+	        nil nil latex-link))
+	      ((string-match "\\\\includegraphics\\([[{]?\\)" latex-link)
+               ;; check for overlay specification and insert if present
+               (message "matched")
+               (replace-match
+	        (format "\\\\includegraphics%s\\1"
+                        (if overlay overlay ""))
+	        nil nil latex-link))
+              (t latex-link)))))
 
 
 ;;;; Plain List
-- 
2.30.2

Reply via email to