[xwiki-users] Formula rendering problem [native]

2012-04-19 Thread Joel Forsberg
Hello!
I've just upgraded both operating system (Fedora 17) and Xwiki to 4.0 RC-1 and 
got an issue with the formula macro. Whenever I use it, the resulting image 
created is 1020x1320 pixels big, mostly empty except for the (correctly sized) 
formula placed in the bottom left corner of the .png image.

Does anyone have an idea what might cause this?

Kind regards, and thanks. Joel

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users



[xwiki-users] Formula rendering problem [native]

2012-04-19 Thread Joel Forsberg
On 04/19/2012 12:34 PM, Joel Forsberg wrote:
 Hello!
 I've just upgraded both operating system (Fedora 17) and Xwiki to 4.0 RC-1 
 and got an issue with the formula macro. Whenever I use it, the resulting 
 image created is 1020x1320 pixels big, mostly empty except for the 
 (correctly sized) formula placed in the bottom left corner of the .png image.

Thu Apr 19 17:49:52 UTC 2012 Sergiu Dumitriu wrote:
It works fine for me, so let's try and see where the problem occurs. 
Start by putting this into a tex file called a.tex:

http://pastebin.com/8Tx92S5L

The renderer uses a three-step process, tex-dvi, dvi-ps, ps-png. 
Let's try them out in order:

latex --interaction=nonstopmode a.tex

This should produce a.dvi, which should be a very big page with only the 
formula in the center, no other text. Check if there are any errors displayed 
there. Try without --interaction to make latex stop at errors.

dvips -E a.dvi -o a.ps

This should produce a.ps, which should be tightly cropped around the 
formula. If it isn't then there's a problem, maybe dvips doesn't support 
the -E parameter.

convert -density 120 a.ps a.png

This should produce a.png, having the same size as the ps.

For reference, here's what I have locally (texlive installation):

$ latex --version
pdfTeX 3.1415926-2.3-1.40.12 (TeX Live 2011)
kpathsea version 6.0.1

$ dvips --version
This is dvips(k) 5.991 Copyright 2011 Radical Eye Software



Thanks for the quick reply. 
My texlive seem to produce a PostScript file that displays okay, but somehow 
the convert step sets the canvas size to 1020x1320
Adding a -trim parameter to will work around the problem, such as:
convert -trim -density 120 a.ps a.png

I'll look for a mention of this behavior for Imagemagick shortly (need food)
(Sorry for messing up the thread, I guess..)

-
For reference:

The files I produced: 
http://www.mediafire.com/file/6qv8tty0pn1nyz0/formula_test2.tar.bz
debug output of convert-step: http://pastebin.com/FdJPEYwr  

convert -version
Version: ImageMagick 6.7.5-6 2012-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

latex --version
pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6)
kpathsea version 3.5.6
Compiled with libpng 1.5.8; using libpng 1.5.10
Compiled with zlib 1.2.5; using zlib 1.2.5
Compiled with libpoppler

dvips --version
dvips(k) 5.96.1
kpathsea version 3.5.6
-
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Formula rendering problem [native]

2012-04-19 Thread Joel Forsberg
Just reporting back results, updating from 
ImageMagick-6.7.5.6-3.fc17.x86_64 to
ImageMagick-6.7.6.5-1.fc18.x86_64

Solved my issue.

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] What is $xwiki.getXMLEncoded()'s purpose in url names?

2010-03-05 Thread Joel Forsberg
On Friday 05 March 2010 04:58:57 Sergiu Dumitriu wrote:
 I need to use getXMLEncoded because the title doesn't always come from 
 the content.

I saw the suggestion to modify the getXMLEncoded route on the JIRA ticket, so 
I decided to do some testing with that. I only know two ways to set the title 
for a document (are there more?) either from the content or the title, and 
here's the results from those. (I have edited the out some hrefs=)

Case 1: Having a document where title field is blank, but having a section as
Document 1: = A damn hr / ruler =
Document 2: = Att-göra-lista =

Results: 
$rdoc.displayTitle  
1 aA damn lt;hr /gt; ruler/a
2 aAtt g#246;ra-lista/a


$xwiki.getXMLEncoded($rdoc.getRenderedTitle('plain/1.0')
1 aA damn #60;hr /#62; ruler/a
2 aAtt göra-lista/a
 
Visually: all the results appears okay and the same in Firefox. (I wonder if 
IE versions can handle the XML output?) The xml route outputs UTF-8 
characters, whereas displayTitle escapes them correctly even if the browser 
selects wrong character encoding. However, the rest of the wiki use utf-8 
consistently so that later case is not likely an issue.


Case 2: Putting the same in proper title field.

Results:
$rdoc.displayTitle
1  a= A damn /ahr/a ruler =/a
2  a= Att göra-lista =/a

$xwiki.getXMLEncoded($rdoc.getRenderedTitle('plain/1.0')
1  a= A damn/apa/a/phr/a/aparuler =/a/p   
  
2  a= Att göra-lista =/a

Visually: As you see, the characters are not escaped at all when using the 
title, no matter what method is being used. Guessing would make me say the 
title field is buggy. The xml route even puts in a few extra p tags for some 
reason.


I think the proper title field needs to be fixed in some way to escape special 
characters before this can be fixed. It might also be good to have an example 
where getXMLEncoded() does any good for panel links at the moment, for testing 
purposes?

-Regards, Joel
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Searching workaround for HTML in title-field

2010-03-05 Thread Joel Forsberg
On Friday 05 March 2010 15:06:34 Sergiu Dumitriu wrote:
snipped
 {pre}{/pre} prevents re-rendering the content.
 
 The result with this is:
 
 A damn
 
 ruler
 
 Which again is a bit wrong, but this is a bug in the core, it always
 assumes that the content that it got from the title field is
 velocity+HTML, even if the page is in xwiki/2.0 syntax.

Do you happen to know the JIRA ticket for this bug? (if there is one?)

The {pre} seems to dodge some of the unwanted effects, but in turn makes 
further editing the script difficult. Next time I edit the {pre} seems to have 
disappeared, instead leaving a p-tag artifact depending on circumstances.

 CrossSiteScripting example: scriptalert('I pwnd U')/script
 = bad, bad, bad
That is exatly what I would like to avoid, hehe. :)

Kind regards, Joel






___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] What is $xwiki.getXMLEncoded()'s purpose in url names?

2010-03-03 Thread Joel Forsberg
Thanks Thomas

I made a JIRA entry against the Panels Application, and a trivial patch to fix 
it. It's my first, so It'll be exciting to see what happens. :)
http://jira.xwiki.org/jira/secure/ManageAttachments.jspa?id=29978

-Joel Forsberg

On Tuesday 02 March 2010 20:20:01 Thomas Mortagne wrote:
 On Tue, Mar 2, 2010 at 18:25, Sergiu Dumitriu ser...@xwiki.com wrote:
  On 03/02/2010 05:01 PM, Joel Forsberg wrote:
  Greetings
 
  On my wiki using swedish characters for xwiki page titles give ugly but
  working entries in all panels, e.g. Backlinks Recent modifications
  and My recent modifications
 
  An example is having:
Startsidor f#246;r v#229;ra intresseomr#229;den
  ...instead of the correct:
Startsidor för våra intresseområden
 
  Another example is putting thiss wiki code on top of a page:
= header thatlook ugly  here =
 
  The script responsible for for the texts in the panels is as follow:
 
  span class=panelitem
  a href=$rdoc.getURL('view')
$xwiki.getXMLEncoded($rdoc.displayTitle)
  /a/span
 
  I've noticed that changing the third line into only $rdoc.displayTitle
  will produce a nice looking entry, and $rdoc is set via
 
  #set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument())
 
  Now, can anyone see a purpose of using getXMLEncoded() for this? As far
  as I have seen, it only breaks things.
 
  This is not caused by getXMLEncoded, it merely makes the problem
  visible. This method must be used in order to prevent other problems:
  Invalid XML, broken layout, XSS...
 
  The problem is that the code inside getDisplayTitle wrongly uses a XML
  escaping option.
 
 No, this is valid because the job of $rdoc.displayTitle is to produce
 xhtml content and theses are valid XML escapes. So you don't need to
 use getXMLEncoded because any xml content is already properly escaped
 (in xwiki/2.0 syntax).
 
 When you want a plain text version of the title you should use
 $rdoc.getRenderedTitle(plain/1.0).
 
  --
  Sergiu Dumitriu
  http://purl.org/net/sergiu/
  ___
  users mailing list
  users@xwiki.org
  http://lists.xwiki.org/mailman/listinfo/users
 
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] What is $xwiki.getXMLEncoded()'s purpose in url names?

2010-03-02 Thread Joel Forsberg

Greetings

On my wiki using swedish characters for xwiki page titles give ugly but 
working entries in all panels, e.g. Backlinks Recent modifications and My 
recent modifications

An example is having:
 Startsidor f#246;r v#229;ra intresseomr#229;den 
...instead of the correct:
 Startsidor för våra intresseområden

Another example is putting thiss wiki code on top of a page:
 = header that look ugly here =

The script responsible for for the texts in the panels is as follow:

span class=panelitem
a href=$rdoc.getURL('view')
 $xwiki.getXMLEncoded($rdoc.displayTitle)
/a/span

I've noticed that changing the third line into only $rdoc.displayTitle will 
produce a nice looking entry, and $rdoc is set via

#set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument())

Now, can anyone see a purpose of using getXMLEncoded() for this? As far as I 
have seen, it only breaks things.

-Joel


- - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Grad. student) Joel Forsberg
KTH Kemisk Teknologi
Teknikringen 41B
100 44 Stockholm
Work +46 8 7908252
e-mail: joe...@kth.se
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] How to reset a forgotten password on Xwiki.org?

2010-02-10 Thread Joel Forsberg

As title. Today, the page 
http://www.xwiki.org/xwiki/bin/view/XWiki/ResetPassword
is not available, because of the permissions.

Error: This page requires programming rights to work, which currently isn't 
the case. Please notify an administrator of this problem and try again later.

If this is intentional (which I doubt), shouldn't there at least be an 
explanation on that page?

Kind regards, Joel
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users