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]
choroba played with the band on Saturday, so Sunday was very sleepy
[choroba]: managed to release Syntax::Construct with 5.28 support in the night, though
[Corion]: choroba: Whee ;)
[Corion]: marto: Ouch - I would've thought that kids adapt much better, but that's obviously not the case...
[marto]: well, their mother let them sleep till 15:00 & 12:00 last week, which didn't help them adjust :P
[Corion]: I was "productive" over the weekend in the sense that I revived my old "Perlmonks on SQLite" code, which likely means I can get a test instance back up running on my webhost. Small steps :)
[Corion]: marto: Ow, no, that doesn't help at all :)
[choroba]: Related to the new release, anyone could explain this or this tester report?
[Discipulus]: hello crew! marto thanks for the message: but I how can I help? i'm testing cpan Padre atm problem with Client::Debug
[choroba]: I don't happen to have 5.10.0 nor 5.8.5 handy...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2018-06-25 08:40 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.