you are right, pngtopnm has problems converting the created pngs. I don't know if wpci creates some sloppy png or the problem is with pngtopnm, since it can convert i.e. screenshots quite fine. But then they are created via intermediate pnms (or something) in the first place, no?


On 01/18/2012 03:56 PM, chm wrote:
The problem appears to be in the pnmtopng/pngtopnm
and possibly the initial creation of the input data
piped to those commands.  I'll add this to the list
of known problems for the 2.4.10 release.  Thanks
for reporting the problem.

--Chris

On 1/18/2012 7:53 AM, Ingo Schmid wrote:




regarding wpic/rpic, the png is shifted one column to the right, as it
looks, but more mysteries go on:


pdl> p $a16(255,;-)
[58905 52505 46105 39705 33305 26905 20505 14105 7705 1305 60441 54041
47641 41241 34841 28441 22041 15641 9241 2841 61977 55577 49177 42777
36377 29977 23577 17177 10777 4377 63513 57113 50713 44313 37913 31513
25113 18713 12313 5913 65049 58649 52249 45849 39449 33049 26649 20249
13849 7449 1049 60185 53785 47385 40985 34585 28185 21785 15385 8985
2585 61721 55321 48921 42521 36121 29721 23321 16921 10521 4121 63257
56857 50457 44057 37657 31257 24857 18457 12057 5657 64793 58393 51993
45593 39193 32793 26393 19993 13593 7193 793 59929 53529 47129 40729
34329 27929 21529 15129 8729 2329 61465 55065 48665 42265 35865 29465
23065 16665 10265 3865 63001 56601 50201 43801 37401 31001 24601 18201
11801 5401 64537 58137 51737 45337 38937 32537 26137 19737 13337 6937
537 59673 53273 46873 40473 34073 27673 21273 14873 8473 2073 61209
54809 48409 42009 35609 29209 22809 16409 10009 3609 62745 56345 49945
43545 37145 30745 24345 17945 11545 5145 64281 57881 51481 45081 38681
32281 25881 19481 13081 6681 281 59417 53017 46617 40217 33817 27417
21017 14617 8217 1817 60953 54553 48153 41753 35353 28953 22553 16153
9753 3353 62489 56089 49689 43289 36889 30489 24089 17689 11289 4889
64025 57625 51225 44825 38425 32025 25625 19225 12825 6425 25 59161
52761 46361 39961 33561 27161 20761 14361 7961 1561 60697 54297 47897
41497 35097 28697 22297 15897 9497 3097 62233 55833 49433 43033 36633
30233 23833 17433 11033 4633 63769 57369 50969 44569 38169 31769 25369
18969 12569 6169]
pdl> p $a16(254,;-)
[58674 52274 45874 39474 33074 26674 20274 13874 7474 1074 60210 53810
47410 41010 34610 28210 21810 15410 9010 2610 61746 55346 48946 42546
36146 29746 23346 16946 10546 4146 63282 56882 50482 44082 37682 31282
24882 18482 12082 5682 64818 58418 52018 45618 39218 32818 26418 20018
13618 7218 818 59954 53554 47154 40754 34354 27954 21554 15154 8754 2354
61490 55090 48690 42290 35890 29490 23090 16690 10290 3890 63026 56626
50226 43826 37426 31026 24626 18226 11826 5426 64562 58162 51762 45362
38962 32562 26162 19762 13362 6962 562 59698 53298 46898 40498 34098
27698 21298 14898 8498 2098 61234 54834 48434 42034 35634 29234 22834
16434 10034 3634 62770 56370 49970 43570 37170 30770 24370 17970 11570
5170 64306 57906 51506 45106 38706 32306 25906 19506 13106 6706 306
59442 53042 46642 40242 33842 27442 21042 14642 8242 1842 60978 54578
48178 41778 35378 28978 22578 16178 9778 3378 62514 56114 49714 43314
36914 30514 24114 17714 11314 4914 64050 57650 51250 44850 38450 32050
25650 19250 12850 6450 50 59186 52786 46386 39986 33586 27186 20786
14386 7986 1586 60722 54322 47922 41522 35122 28722 22322 15922 9522
3122 62258 55858 49458 43058 36658 30258 23858 17458 11058 4658 63794
57394 50994 44594 38194 31794 25394 18994 12594 6194 65330 58930 52530
46130 39730 33330 26930 20530 14130 7730 1330 60466 54066 47666 41266
34866 28466 22066 15666 9266 2866 62002 55602 49202 42802 36402 30002
23602 17202 10802 4402 63538 57138 50738 44338 37938 31538 25138 18738
12338 5938]

pdl> p $a16(0,;-)
[0 59136 52736 46336 39936 33536 27136 20736 14336 7936 1536 60672 54272
47872 41472 35072 28672 22272 15872 9472 3072 62208 55808 49408 43008
36608 30208 23808 17408 11008 4608 63744 57344 50944 44544 38144 31744
25344 18944 12544 6144 65280 58880 52480 46080 39680 33280 26880 20480
14080 7680 1280 60416 54016 47616 41216 34816 28416 22016 15616 9216
2816 61952 55552 49152 42752 36352 29952 23552 17152 10752 4352 63488
57088 50688 44288 37888 31488 25088 18688 12288 5888 65024 58624 52224
45824 39424 33024 26624 20224 13824 7424 1024 60160 53760 47360 40960
34560 28160 21760 15360 8960 2560 61696 55296 48896 42496 36096 29696
23296 16896 10496 4096 63232 56832 50432 44032 37632 31232 24832 18432
12032 5632 64768 58368 51968 45568 39168 32768 26368 19968 13568 7168
768 59904 53504 47104 40704 34304 27904 21504 15104 8704 2304 61440
55040 48640 42240 35840 29440 23040 16640 10240 3840 62976 56576 50176
43776 37376 30976 24576 18176 11776 5376 64512 58112 51712 45312 38912
32512 26112 19712 13312 6912 512 59648 53248 46848 40448 34048 27648
21248 14848 8448 2048 61184 54784 48384 41984 35584 29184 22784 16384
9984 3584 62720 56320 49920 43520 37120 30720 24320 17920 11520 5120
64256 57856 51456 45056 38656 32256 25856 19456 13056 6656 256 59392
52992 46592 40192 33792 27392 20992 14592 8192 1792 60928 54528 48128
41728 35328 28928 22528 16128 9728 3328 62464 56064 49664 43264 36864
30464 24064 17664 11264 4864 64000 57600 51200 44800 38400 32000 25600
19200 12800]
pdl> p $a16_png(1,;-)
[0 59136 52736 46336 39936 33536 27136 20736 14336 7936 1536 60672 54272
47872 41472 35072 28672 22272 15872 9472 3072 62208 55808 49408 43008
36608 30208 23808 17408 11008 4608 63744 57344 50944 44544 38144 31744
25344 18944 12544 6144 65280 58880 52480 46080 39680 33280 26880 20480
14080 7680 1280 60416 54016 47616 41216 34816 28416 22016 15616 9216
2816 61952 55552 49152 42752 36352 29952 23552 17152 10752 4352 63488
57088 50688 44288 37888 31488 25088 18688 12288 5888 65024 58624 52224
45824 39424 33024 26624 20224 13824 7424 1024 60160 53760 47360 40960
34560 28160 21760 15360 8960 2560 61696 55296 48896 42496 36096 29696
23296 16896 10496 4096 63232 56832 50432 44032 37632 31232 24832 18432
12032 5632 64768 58368 51968 45568 39168 32768 26368 19968 13568 7168
768 59904 53504 47104 40704 34304 27904 21504 15104 8704 2304 61440
55040 48640 42240 35840 29440 23040 16640 10240 3840 62976 56576 50176
43776 37376 30976 24576 18176 11776 5376 64512 58112 51712 45312 38912
32512 26112 19712 13312 6912 512 59648 53248 46848 40448 34048 27648
21248 14848 8448 2048 61184 54784 48384 41984 35584 29184 22784 16384
9984 3584 62720 56320 49920 43520 37120 30720 24320 17920 11520 5120
64256 57856 51456 45056 38656 32256 25856 19456 13056 6656 256 59392
52992 46592 40192 33792 27392 20992 14592 8192 1792 60928 54528 48128
41728 35328 28928 22528 16128 9728 3328 62464 56064 49664 43264 36864
30464 24064 17664 11264 4864 64000 57600 51200 44800 38400 32000 25600
19200 12800]


A simpler case shows it as well:

pdl> $a=sequence(110)->reshape(11,10)*231



pdl> p $a

[
[ 0 231 462 693 924 1155 1386 1617 1848 2079 2310]
[ 2541 2772 3003 3234 3465 3696 3927 4158 4389 4620 4851]
[ 5082 5313 5544 5775 6006 6237 6468 6699 6930 7161 7392]
[ 7623 7854 8085 8316 8547 8778 9009 9240 9471 9702 9933]
[10164 10395 10626 10857 11088 11319 11550 11781 12012 12243 12474]
[12705 12936 13167 13398 13629 13860 14091 14322 14553 14784 15015]
[15246 15477 15708 15939 16170 16401 16632 16863 17094 17325 17556]
[17787 18018 18249 18480 18711 18942 19173 19404 19635 19866 20097]
[20328 20559 20790 21021 21252 21483 21714 21945 22176 22407 22638]
[22869 23100 23331 23562 23793 24024 24255 24486 24717 24948 25179]

p $a->ushort

[
[ 0 231 462 693 924 1155 1386 1617 1848 2079 2310]
[ 2541 2772 3003 3234 3465 3696 3927 4158 4389 4620 4851]
[ 5082 5313 5544 5775 6006 6237 6468 6699 6930 7161 7392]
[ 7623 7854 8085 8316 8547 8778 9009 9240 9471 9702 9933]
[10164 10395 10626 10857 11088 11319 11550 11781 12012 12243 12474]
[12705 12936 13167 13398 13629 13860 14091 14322 14553 14784 15015]
[15246 15477 15708 15939 16170 16401 16632 16863 17094 17325 17556]
[17787 18018 18249 18480 18711 18942 19173 19404 19635 19866 20097]
[20328 20559 20790 21021 21252 21483 21714 21945 22176 22407 22638]
[22869 23100 23331 23562 23793 24024 24255 24486 24717 24948 25179]

pdl> $a=sequence(110)->reshape(11,10)*231
pdl> $a->wpic('a.png')


pdl> $b=rpic('a.png')

pdl> p $b

[
[ 0 2 5 7 9 12 14 16 19 21 23]
[ 26 28 30 33 35 37 40 42 44 47 49]
[ 51 54 56 58 61 63 66 68 70 73 75]
[ 77 80 82 84 87 89 91 94 96 98 101]
[103 105 108 110 112 115 117 119 122 124 126]
[129 131 133 136 138 140 143 145 147 150 152]
[154 157 159 161 164 166 168 171 173 175 178]
[180 182 185 187 189 192 194 197 199 201 204]
[206 208 211 213 215 218 220 222 225 227 229]
[232 234 236 239 241 243 246 248 250 253 255]
]

pdl> help vars
PDL variables in package main::

Name Type Dimension Flow State Mem
----------------------------------------------------------------
$a Double D [11,10] P 0.86KB
$b Byte D [11,10] P 0.11KB

pdl> $a->ushort->wpic('a.png')
pdl> $b=rpic('a.png')
pdl> p $b

[
[ 0 0 59136 0 52736 256 46336 512 39936 768 33536]
[60672 2304 54272 2560 47872 2816 41472 3072 35072 3328 28672]
[55808 4864 49408 5120 43008 5376 36608 5632 30208 5888 23808]
[50944 7424 44544 7680 38144 7936 31744 8192 25344 8448 18944]
[46080 9984 39680 10240 33280 10496 26880 10752 20480 11008 14080]
[41216 12544 34816 12800 28416 13056 22016 13312 15616 13568 9216]
[36352 15104 29952 15360 23552 15616 17152 15872 10752 16128 4352]
[31488 17664 25088 17920 18688 18176 12288 18432 5888 18688 65024]
[26624 20224 20224 20480 13824 20736 7424 20992 1024 21248 60160]
[21760 22784 15360 23040 8960 23296 2560 23552 61696 23552 55296]


On 01/17/2012 09:19 PM, Chris Marshall wrote:
Nonetheless, the images look ok which
suggests that the *test checks* are failing
and not necessarily the PNM and PNG
image input and output. Ingo will need
to debug that on his end unless you can
reproduce the problem on your end.

--Chris

On Tue, Jan 17, 2012 at 2:53 PM, David
Mertens<[email protected]> wrote:
On Tue, Jan 17, 2012 at 12:49 PM, Chris Marshall<[email protected]>
wrote:
My guess is that the test is checking for equality
rather than approximately.

Could you run the test in the debugger and see
what the value of sum(abs($a16-$a16_png)) is
for the failing test?

What are the data types of the piddles being
compared?

The types are PDL ushorts, so they really should not suffer rounding
errors.
Also, my hunch was wrong: shorts appear to be consistently 16 bits, as
discussed here: http://en.cppreference.com/w/cpp/language/types

David


Thanks,
Chris

On Tue, Jan 17, 2012 at 1:29 PM, Ingo Schmid<[email protected]> wrote:
I still get an error, although the images look the same (s.
attachments),
according to diff.

riococo:[tmp]$ perl pic_16bit.t
1..5
ok 1 - use PDL::IO::Pic;
Using the command NONE with the flags -quiet
scaling data to type byte...
using intermediate format PGM
built the command>tbyte_a.pnm to write image
conversion by 'tbyte_a.pnm'
ok 2 - pnm byte image save+restore
Using the command pnmtopng with the flags -quiet
scaling data to type byte...
using intermediate format PGM
built the command |pnmtopng -quiet>tbyte_b.png to write image
conversion by 'pngtopnm -quiet tbyte_b.png |'
ok 3 - png byte image save+restore
Using the command NONE with the flags -quiet
using intermediate format PGM
built the command>tushort_a16.pnm to write image
conversion by 'tushort_a16.pnm'
ok 4 - pnm ushort image save+restore
Using the command pnmtopng with the flags -quiet
using intermediate format PGM
built the command |pnmtopng -quiet>tushort_b16.png to write image
conversion by 'pngtopnm -quiet tushort_b16.png |'
not ok 5 - png ushort image save+restore
# Failed test 'png ushort image save+restore'
# at pic_16bit.t line 66.
# Looks like you failed 1 test of 5.

Best
Ingo



On 01/17/2012 06:57 PM, Chris Marshall wrote:
Please run this modified pic_16bit.t and send the
generated files. I've attached a tar file with the new
test as well as the images output on my platform
(which look ok).

Thanks,
Chris

On Tue, Jan 17, 2012 at 9:25 AM, David
Mertens<[email protected]>
wrote:
Ingo -

Do I understand correctly that you *updated* the PDL ebuild? If so,
you
have
my thanks, as well as the thanks from the rest of the porters! We
should
add
instructions to our wiki for installing PDL on Gentoo. Anything that
makes
PDL easier to install on any platform should be mentioned.

Now, as to your bug, my test passes and looks like the
tushort_a16.png
image
that you attached in your follow-up. I have not worked with (or on)
PDL::IO::Pic and I do not have experience with the C library that
backs
it
up, so I cannot be of much help, at least, not with the details that
you
have posted so far. However, this looks like a bona-fide bug, so we
should
probably file a bug report. If you have a sourceforge account, I
would
appreciate if you could file a bug here:


http://sourceforge.net/tracker/?func=browse&group_id=612&atid=100612&status=1.

If you do not have a sourceforge account, please reply with the
output
of
"perldl -V" so that I can include it in the bug report.

Last point: from the build log, it looks like you have a 64 bit AMD
chip.
I
wonder if this is an issue with 64 bit builds, especially the 64 bit
representation of PDL's short type. But that's just a hunch.

David

--
Sent via my carrier pigeon.

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl



--
Sent via my carrier pigeon.



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1416 / Virus Database: 2109/4751 - Release Date: 01/18/12




_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to