emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Inline Images Showing as Link
@ 2011-04-20 23:46 Andy Jewell
  2011-04-21  8:15 ` Aankhen
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Jewell @ 2011-04-20 23:46 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

Hi. . . I'm having trouble getting an image URL to render as an inline image
in the html export.  It always renders it as a link.

I have an image saved on Google but Google doesn't preserve the extension
which I think confuses org-mode since it doesn't look like an image.  Here's
the markup:

* See the image below:
  [[https://docs.google
.com/leaf?id=0B-swGEqSDpxyMjgwNjE0MzEtMTA4OC00NTdmLWE3MjktMDJmOGE5ZWM2YjY0&hl=en
]]
* See the image above

I've tried adding a caption thinking that would provide a hint to render as
an image but no success there.

Can someone advise if there an option I'm missing?

Thanks!

Andy

[-- Attachment #2: Type: text/html, Size: 1194 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Inline Images Showing as Link
  2011-04-20 23:46 Inline Images Showing as Link Andy Jewell
@ 2011-04-21  8:15 ` Aankhen
  2011-04-21  8:34   ` Manuel Giraud
  2011-04-21 13:16   ` Nick Dokos
  0 siblings, 2 replies; 7+ messages in thread
From: Aankhen @ 2011-04-21  8:15 UTC (permalink / raw)
  To: Andy Jewell, Org-mode ml

Hi Andy,

On Thu, Apr 21, 2011 at 05:16, Andy Jewell <ajewell@adaptu.com> wrote:
> Hi. . . I'm having trouble getting an image URL to render as an inline image
> in the html export.  It always renders it as a link.
>
> I have an image saved on Google but Google doesn't preserve the extension
> which I think confuses org-mode since it doesn't look like an image.  Here's
> the markup:
>
> * See the image below:
>
> [[https://docs.google.com/leaf?id=0B-swGEqSDpxyMjgwNjE0MzEtMTA4OC00NTdmLWE3MjktMDJmOGE5ZWM2YjY0&hl=en]]
> * See the image above
>
> I've tried adding a caption thinking that would provide a hint to render as
> an image but no success there.
>
> Can someone advise if there an option I'm missing?

The exporter uses the extension to figure out whether the location
being linked to is an image.  There is no extension here, so it
assumes you’re linking to a normal page.  Here are a few of the
relevant bits:

,----[ C-h v org-export-html-inline-image-extensions RET ]
| org-export-html-inline-image-extensions is a variable defined in
`org-html.el'.
| Its value is ("png" "jpeg" "jpg" "gif" "svg")
|
|
| Documentation:
| Extensions of image files that can be inlined into HTML.
|
| You can customize this variable.
`----

,----[ C-h f org-file-image-p RET ]
| org-file-image-p is a compiled Lisp function in `org.el'.
|
| (org-file-image-p FILE &optional EXTENSIONS)
|
| Return non-nil if FILE is an image.
`----

I think you’d need to majorly rejigger them to make Org recognize your
link as an image.

Aankhen

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Inline Images Showing as Link
  2011-04-21  8:15 ` Aankhen
@ 2011-04-21  8:34   ` Manuel Giraud
  2011-04-21 11:03     ` Radosław Grzanka
  2011-04-21 13:16   ` Nick Dokos
  1 sibling, 1 reply; 7+ messages in thread
From: Manuel Giraud @ 2011-04-21  8:34 UTC (permalink / raw)
  To: Aankhen; +Cc: Andy Jewell, Org-mode ml


Hi,

Aankhen <aankhen@gmail.com> writes:

> [...]
> I think you’d need to majorly rejigger them to make Org recognize your
> link as an image.


And it doesn't seem to work in HTML anyway. I just tried to render this:

--8<---------------cut here---------------start------------->8---
<img src="https://docs.google.com/leaf?id=0B-swGEqSDpxyMjgwNjE0MzEtMTA4OC00NTdmLWE3MjktMDJmOGE5ZWM2YjY0&hl=en"  alt="none"/>
--8<---------------cut here---------------end--------------->8---

in firefox and only get the alternative. (its the google way of web).

-- 
Manuel Giraud

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Inline Images Showing as Link
  2011-04-21  8:34   ` Manuel Giraud
@ 2011-04-21 11:03     ` Radosław Grzanka
  2011-04-21 12:05       ` Manuel Giraud
  0 siblings, 1 reply; 7+ messages in thread
From: Radosław Grzanka @ 2011-04-21 11:03 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

W dniu 2011-04-21 10:34, Manuel Giraud pisze:
>
> Hi,
>
> Aankhen<aankhen@gmail.com>  writes:
>
>> [...]
>> I think you’d need to majorly rejigger them to make Org recognize your
>> link as an image.
>
>
> And it doesn't seem to work in HTML anyway. I just tried to render this:
>
> --8<---------------cut here---------------start------------->8---
> <img src="https://docs.google.com/leaf?id=0B-swGEqSDpxyMjgwNjE0MzEtMTA4OC00NTdmLWE3MjktMDJmOGE5ZWM2YjY0&hl=en"  alt="none"/>
> --8<---------------cut here---------------end--------------->8---
>
> in firefox and only get the alternative. (its the google way of web).
>

That is because this is not link to image but to the page that shows 
image. Direct link to image is 
https://lh6.googleusercontent.com/KXI0totQ7IlQlRpUqszAYhRM0ldASL6vdl3VWDEswuoStG-jMMbNffNW-pHwRCR_xiXpgGNNaZGZfUWJ9UlGHjvwxQ=s512

and

<img 
src="https://lh6.googleusercontent.com/KXI0totQ7IlQlRpUqszAYhRM0ldASL6vdl3VWDEswuoStG-jMMbNffNW-pHwRCR_xiXpgGNNaZGZfUWJ9UlGHjvwxQ=s512" 
  alt="none"/>

works fine. However, giving that this is some google docs image over 
https it probably will not always work.

Cheers,
   Radek.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Inline Images Showing as Link
  2011-04-21 11:03     ` Radosław Grzanka
@ 2011-04-21 12:05       ` Manuel Giraud
  0 siblings, 0 replies; 7+ messages in thread
From: Manuel Giraud @ 2011-04-21 12:05 UTC (permalink / raw)
  To: radoslawg; +Cc: emacs-orgmode

Radosław Grzanka <radoslawg@gmail.com> writes:

> [...]
> <img
> src="https://lh6.googleusercontent.com/KXI0totQ7IlQlRpUqszAYhRM0ldASL6vdl3VWDEswuoStG-jMMbNffNW-pHwRCR_xiXpgGNNaZGZfUWJ9UlGHjvwxQ=s512"
> alt="none"/>
>
> works fine. However, giving that this is some google docs image over
> https it probably will not always work.

Then the OP can do something like this:

(add-to-list 'org-export-html-inline-image-extensions 
             "com/KXI0totQ7IlQlRpUqszAYhRM0ldASL6vdl3VWDEswuoStG-jMMbNffNW-pHwRCR_xiXpgGNNaZGZfUWJ9UlGHjvwxQ=s512")

and html export will work afterwards (my eyes! it hurts!)

-- 
Manuel Giraud

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Inline Images Showing as Link
  2011-04-21  8:15 ` Aankhen
  2011-04-21  8:34   ` Manuel Giraud
@ 2011-04-21 13:16   ` Nick Dokos
  2011-04-21 15:41     ` Andy Jewell
  1 sibling, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2011-04-21 13:16 UTC (permalink / raw)
  To: Aankhen; +Cc: Andy Jewell, nicholas.dokos, Org-mode ml

Aankhen <aankhen@gmail.com> wrote:


> 
> I think you’d need to majorly rejigger them to make Org recognize your
> link as an image.
> 

Agreed, but in addition, I don't think that the link *is* an image at
all: I visit, View Source and get a faceful of HTML and JS.

Forget about org: just write a simple HTML page with an <img> tag and
that URL as its source - does it work? It sure doesn't work for me.

Nick

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Inline Images Showing as Link
  2011-04-21 13:16   ` Nick Dokos
@ 2011-04-21 15:41     ` Andy Jewell
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Jewell @ 2011-04-21 15:41 UTC (permalink / raw)
  To: Org-mode ml

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

Ah - thanks to all for clarifying the issues.  Looks like my grand plan of
pulling my images from Google is not so grand after all.  Thanks again!

Andy

On Thu, Apr 21, 2011 at 6:16 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Aankhen <aankhen@gmail.com> wrote:
>
>
> >
> > I think you’d need to majorly rejigger them to make Org recognize your
> > link as an image.
> >
>
> Agreed, but in addition, I don't think that the link *is* an image at
> all: I visit, View Source and get a faceful of HTML and JS.
>
> Forget about org: just write a simple HTML page with an <img> tag and
> that URL as its source - does it work? It sure doesn't work for me.
>
> Nick
>

[-- Attachment #2: Type: text/html, Size: 1106 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-04-21 15:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-20 23:46 Inline Images Showing as Link Andy Jewell
2011-04-21  8:15 ` Aankhen
2011-04-21  8:34   ` Manuel Giraud
2011-04-21 11:03     ` Radosław Grzanka
2011-04-21 12:05       ` Manuel Giraud
2011-04-21 13:16   ` Nick Dokos
2011-04-21 15:41     ` Andy Jewell

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).