Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2018-03-24 01:39 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (297 votes). Check out past polls.