Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Importing a PNG image to a piddle

by syphilis (Chancellor)
on Jul 18, 2012 at 00:26 UTC ( #982355=note: print w/replies, xml ) Need Help??

in reply to Importing a PNG image to a piddle

'can\'t figure out file type, specify explicitly'

You need to specify the format. (Seems to be a Windows thing only.) So, I would do:
my $piddle = PDL->rpic($path, {FORMAT => 'PNG'});
which works fine for me (iff pngtopnm.exe/pnmtopng.exe are in my path). I'm not familiar with the rim() function - afaict
my $piddle = rim($path, {FORMAT => 'PNG'});
should also work, but for me that just produces:
Can't locate object method "dim" via package "file.png" (perhaps you f +orgot to load "file.png"?) at C:/MinGW/perl516/site/lib/PDL/IO/ + line 570.
Update: the rim() function is broken in my build of PDL (version 2.4.11), and may well have been broken for quite some time.
It just calls rpic() anyway, so use that instead.

(For my test script, $path was set to file.png ... obviously.)


Replies are listed 'Best First'.
Re^2: Importing a PNG image to a piddle
by perldough (Sexton) on Jul 18, 2012 at 15:56 UTC
    You are right, using rpic does get rid of the error, but when I look in my piddle, it's all black. I ended up using GD. Thanks very much for your time.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982355]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2016-10-28 21:49 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (387 votes). Check out past polls.