Discussion:
[Dvipng] -T ignored
keenerd
2010-07-13 10:49:43 UTC
Permalink
Jan-Åke Larsson
2010-07-26 15:02:55 UTC
Permalink
Hi,
I cannot reproduce this. When I follow the mentioned steps using
test_dvipng.dvi from the distribution, the result is 400 by 800 px.
What version are you using?

This should be DVI-independent (heh) but feel free to provide a DVI that
does not work.

/JÅ

On 2010-07-13 12:49, keenerd wrote:
keenerd
2010-07-28 13:35:22 UTC
Permalink
I am using dvipng 1.12 on 64 bit Arch linux. It also happens with the
binary at http://tug.org/svn/texlive/trunk/Master/bin/x86_64-linux/dvipng
Its been reproducible here, but the maintainer thinks it is upstream.

Command
dvipng -T "4in,6in" -O "1in,1in" -D 100 test.dvi
results in a 400x400 png. (Also horribly offcenter, but fixable with
better -O.)

Dvi, tex, png attached.

-Kyle
Post by Jan-Åke Larsson
Hi,
I cannot reproduce this. When I follow the mentioned steps using
test_dvipng.dvi from the distribution, the result is 400 by 800 px.
What version are you using?
This should be DVI-independent (heh) but feel free to provide a DVI that
does not work.
/JÅ
Jan-Åke Larsson
2010-08-08 13:20:14 UTC
Permalink
Hm, OK. Strange. I still cannot reproduce it (although that binary won't
work here, I've only got 32 bit linux available). As far as I can see,
nothing in the code would be able to trigger this. (Being unable to read
the height would return a 400x1 image.)

Could you try the following and report the output

dvipng -D 100 test.dvi -

At the prompt, write

-T 4in,6in <RET>
-pp 1 <RET>
<CTRL>-D

That should report the image size that gets read. Let's see if that is
correct.

/JÅ
Post by keenerd
I am using dvipng 1.12 on 64 bit Arch linux. It also happens with the
binary at http://tug.org/svn/texlive/trunk/Master/bin/x86_64-linux/dvipng
Its been reproducible here, but the maintainer thinks it is upstream.
Command
dvipng -T "4in,6in" -O "1in,1in" -D 100 test.dvi
results in a 400x400 png. (Also horribly offcenter, but fixable with
better -O.)
Dvi, tex, png attached.
-Kyle
Post by Jan-Åke Larsson
Hi,
I cannot reproduce this. When I follow the mentioned steps using
test_dvipng.dvi from the distribution, the result is 400 by 800 px.
What version are you using?
This should be DVI-independent (heh) but feel free to provide a DVI that
does not work.
/JÅ
Rémy Oudompheng
2010-09-28 21:04:52 UTC
Permalink
Post by Jan-Åke Larsson
Hm, OK. Strange. I still cannot reproduce it (although that binary won't
work here, I've only got 32 bit linux available). As far as I can see,
nothing in the code would be able to trigger this. (Being unable to read
the height would return a 400x1 image.)
Could you try the following and report the output
dvipng -D 100 test.dvi -
At the prompt, write
-T 4in,6in <RET>
-pp 1 <RET>
<CTRL>-D
That should report the image size that gets read. Let's see if that is
correct.
Hello,

It's not correct, either with the 32-bit binary nor with the 64-bit
one. A gdb pass tells me that in papersiz.c, the first number is read
both in variables x and y. After reading the first number, the pointer
p should be advanced to read the second one. I don't know how this is
possible in the myatodim function: my intuition would be to add some
"*p=q" at the end. Adding such a line indeed restores correct
behaviour. Am I mistaken by a compiler bug ?

static int32_t myatodim(const char ** p)
{
double tmp; /* double accuracy is enough, I think */
int i=0;
char *q;

tmp = strtod(*p,&q);
while (*q == ' ')
q++;
while (i<8 && (q[0]!=lengthnames[i][0] || q[1]!=lengthnames[i][1]))
i++;
if (i==8 && (q[0]!=lengthnames[i][0] || q[1]!=lengthnames[i][1]))
Warning("unrecognized length unit \"%.2s\", assuming inches",q);
while (*q != ',' && *q !='\0')
q++;
tmp = tmp*lengthsp[i]*dpi/4736286L; /* sp * dots/in / (sp/in),
convert sp to pixels */
return((int32_t) tmp);
}
Jan-Åke Larsson
2010-09-29 09:31:40 UTC
Permalink
Nope, I can confirm that behaviour here as well. I wonder what made my
tests succeed. I'll add that in the upcoming 1.14 release.
For the time being, v1.12 does not have this problem.

/JÅ
Jan-Åke Larsson
2010-09-29 09:30:39 UTC
Permalink
Post by Rémy Oudompheng
It's not correct, either with the 32-bit binary nor with the 64-bit
one. A gdb pass tells me that in papersiz.c, the first number is read
both in variables x and y. After reading the first number, the pointer
p should be advanced to read the second one. I don't know how this is
possible in the myatodim function: my intuition would be to add some
"*p=q" at the end. Adding such a line indeed restores correct
behaviour. Am I mistaken by a compiler bug ?
Nope, I can confirm that behaviour here as well. I wonder what made my
tests succeed. I'll add that in the upcoming 1.14 release.

Thanks,
/JÅ
Jan-Åke Larsson
2010-10-26 10:27:58 UTC
Permalink
This is fixed in CVS. Release is expected soon.
/JÅ
--
UNIX _is_ user friendly. It's just selective about who its friends are.
Loading...