Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Importing a PNG image to a piddle

by syphilis (Canon)
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/Pic.pm + 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.)

Cheers,


Comment on Re: Importing a PNG image to a piddle
Select or Download Code
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (14)
As of 2014-07-22 14:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (114 votes), past polls