emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Babel] why did ob-ditaa generate image file fail in orgmode?
@ 2011-03-16 14:19 Eric Luo
  2011-03-16 14:39 ` Eric S Fraga
  2011-03-16 15:31 ` Eric Schulte
  0 siblings, 2 replies; 6+ messages in thread
From: Eric Luo @ 2011-03-16 14:19 UTC (permalink / raw)
  To: emacs-orgmode



Hi, I have the following snippet in one of my org files, and have the
babel settings as following:

,----
| (setq org-ditaa-jar-path
| "~/.emacs.d/org-mode/contrib/scripts/ditaa.jar")
| (org-babel-do-load-languages
|  'org-babel-load-languages (quote ((emacs-lisp . t)
|                                    (dot . t)
|                                    (ditaa . t)
|                                    (R . t))))
`----

  when I evaluated the snippet,
,----
| 
| executing Ditaa code block... java -jar
| /Users/eric/.emacs.d/org-mode/contrib/scripts/ditaa.jar
| /var/folders/7x/7x730t2UEpec6mgk8rHiyk\+\+\+TI/-Tmp-/babel-777G0f/ditaa-777shg
| /Users/eric/test.png
| 
| ditaa version 0.9, Copyright (C) 2004--2009 Efstathios (Stathis) Sideris
| 
| Running with options: Reading file:
| /var/folders/7x/7x730t2UEpec6mgk8rHiyk+++TI/-Tmp-/babel-777G0f/ditaa-777shg
| Locale: zh_CN Dialog Rendering to file: /Users/eric/test.png Done in
| 1sec Code block evaluation complete.
`----

It seems successed, but when I open the test.png, it is said that this
file is corrupted.

It's ok if I execute the commandline(java -jar ...) in the shell. It's
very strange, and tested in ubuntu and Mac OSX.

Any clues, thanks

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

* Re: [Babel] why did ob-ditaa generate image file fail in orgmode?
  2011-03-16 14:19 [Babel] why did ob-ditaa generate image file fail in orgmode? Eric Luo
@ 2011-03-16 14:39 ` Eric S Fraga
  2011-03-16 14:53   ` Eric Luo
  2011-03-16 15:31 ` Eric Schulte
  1 sibling, 1 reply; 6+ messages in thread
From: Eric S Fraga @ 2011-03-16 14:39 UTC (permalink / raw)
  To: Eric Luo; +Cc: emacs-orgmode

Eric Luo <eric.wenbl@gmail.com> writes:

> Hi, I have the following snippet in one of my org files, and have the
> babel settings as following:

[...]

> It seems successed, but when I open the test.png, it is said that this
> file is corrupted.
>
> It's ok if I execute the commandline(java -jar ...) in the shell. It's
> very strange, and tested in ubuntu and Mac OSX.
>
> Any clues, thanks

What was the snippet?  (or at least a minimal version of one that
exhibits the problem)
-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.55.g87c42.dirty)

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

* Re: [Babel] why did ob-ditaa generate image file fail in orgmode?
  2011-03-16 14:39 ` Eric S Fraga
@ 2011-03-16 14:53   ` Eric Luo
  2011-03-16 15:06     ` Eric S Fraga
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Luo @ 2011-03-16 14:53 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
> What was the snippet?  (or at least a minimal version of one that
> exhibits the problem)

Sorry for my mistake, I've forgotten the snippet, actually no matter
what i put in the block, the image couldn't be opened if the
generated it in orgmode.

Anyway, what the snippet is:

#+begin_src ditaa :file ~/test.png
  test
#+end_src

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

* Re: Re: [Babel] why did ob-ditaa generate image file fail in orgmode?
  2011-03-16 14:53   ` Eric Luo
@ 2011-03-16 15:06     ` Eric S Fraga
  2011-03-17 14:27       ` Eric Luo
  0 siblings, 1 reply; 6+ messages in thread
From: Eric S Fraga @ 2011-03-16 15:06 UTC (permalink / raw)
  To: Eric Luo; +Cc: emacs-orgmode

Eric Luo <eric.wenbl@gmail.com> writes:

> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>>
>> What was the snippet?  (or at least a minimal version of one that
>> exhibits the problem)
>
> Sorry for my mistake, I've forgotten the snippet, actually no matter
> what i put in the block, the image couldn't be opened if the
> generated it in orgmode.
>
> Anyway, what the snippet is:
>
> #+begin_src ditaa :file ~/test.png
>   test
> #+end_src

Now *this* is what I call a minimal example! ;-)

In any case, it works for me just fine.  Excerpt from the *Messages*
buffer:

--8<---------------cut here---------------start------------->8---
executing Ditaa code block...
java -jar /home/ucecesf/git/org-mode/contrib/scripts/ditaa.jar  /tmp/babel-244564L/ditaa-24454bP /home/ucecesf/test.png

ditaa version 0.9, Copyright (C) 2004--2009  Efstathios (Stathis) Sideris

Running with options:
Reading file: /tmp/babel-244564L/ditaa-24454bP
Locale: en_GB
Dialog.bold
Rendering to file: /home/ucecesf/test.png
Done in 0sec
Code block evaluation complete.
--8<---------------cut here---------------end--------------->8---

The only difference I see between your messages and mine is the locale
(and I have Dialog.bold instead of just Dialog for some reason but I
don't know what that means...).

What version of org are you using?  How do you open the .png file?

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.55.g87c42.dirty)

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

* Re: [Babel] why did ob-ditaa generate image file fail in orgmode?
  2011-03-16 14:19 [Babel] why did ob-ditaa generate image file fail in orgmode? Eric Luo
  2011-03-16 14:39 ` Eric S Fraga
@ 2011-03-16 15:31 ` Eric Schulte
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Schulte @ 2011-03-16 15:31 UTC (permalink / raw)
  To: Eric Luo; +Cc: emacs-orgmode

Eric Luo <eric.wenbl@gmail.com> writes:

> Hi, I have the following snippet in one of my org files, and have the
> babel settings as following:
>
> ,----
> | (setq org-ditaa-jar-path
> | "~/.emacs.d/org-mode/contrib/scripts/ditaa.jar")
> | (org-babel-do-load-languages
> |  'org-babel-load-languages (quote ((emacs-lisp . t)
> |                                    (dot . t)
> |                                    (ditaa . t)
> |                                    (R . t))))
> `----
>
>   when I evaluated the snippet,
> ,----
> | 
> | executing Ditaa code block... java -jar
> | /Users/eric/.emacs.d/org-mode/contrib/scripts/ditaa.jar
> | /var/folders/7x/7x730t2UEpec6mgk8rHiyk\+\+\+TI/-Tmp-/babel-777G0f/ditaa-777shg
> | /Users/eric/test.png
> | 
> | ditaa version 0.9, Copyright (C) 2004--2009 Efstathios (Stathis) Sideris
> | 
> | Running with options: Reading file:
> | /var/folders/7x/7x730t2UEpec6mgk8rHiyk+++TI/-Tmp-/babel-777G0f/ditaa-777shg
> | Locale: zh_CN Dialog Rendering to file: /Users/eric/test.png Done in
> | 1sec Code block evaluation complete.
> `----
>

That is strange, there should be no difference between a shell command
run by Emacs or by hand.  If you copy the above directly from your
*messages* buffer into a shell, then the invocation works?

Are those newlines inserted by your email client, or are there really
newlines embedded into the ditaa command line?  Meaning is Emacs trying
to execute this

| /Users/eric/.emacs.d/org-mode/contrib/scripts/ditaa.jar
| /var/folders/7x/7x730t2UEpec6mgk8rHiyk\+\+\+TI/-Tmp-/babel-777G0f/ditaa-777shg
| /Users/eric/test.png

or this

| /Users/eric/.emacs.d/org-mode/contrib/scripts/ditaa.jar /var/folders/7x/7x730t2UEpec6mgk8rHiyk\+\+\+TI/-Tmp-/babel-777G0f/ditaa-777shg  /Users/eric/test.png

Judging by your formatting I'd guess the former, which seems strange.

Best -- Eric

>
> It seems successed, but when I open the test.png, it is said that this
> file is corrupted.
>
> It's ok if I execute the commandline(java -jar ...) in the shell. It's
> very strange, and tested in ubuntu and Mac OSX.
>
> Any clues, thanks

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

* Re: [Babel] why did ob-ditaa generate image file fail in orgmode?
  2011-03-16 15:06     ` Eric S Fraga
@ 2011-03-17 14:27       ` Eric Luo
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Luo @ 2011-03-17 14:27 UTC (permalink / raw)
  To: emacs-orgmode

Thanks for your reminder, I updated the orgmode to the lastest, now it's ok

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

end of thread, other threads:[~2011-03-17 14:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-16 14:19 [Babel] why did ob-ditaa generate image file fail in orgmode? Eric Luo
2011-03-16 14:39 ` Eric S Fraga
2011-03-16 14:53   ` Eric Luo
2011-03-16 15:06     ` Eric S Fraga
2011-03-17 14:27       ` Eric Luo
2011-03-16 15:31 ` Eric Schulte

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).