CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
Windows GD module creates corrupt png files

 



ulysses31
New User

Feb 6, 2008, 7:17 AM

Post #1 of 4 (4501 views)
Windows GD module creates corrupt png files Can't Post

Hi,

I'm pulling my hair out trying to find out what I'm doing wrong so any help would be appreciated. I am running WindowsXP and I've installed<span> Perl v5.8.8, built for MSWin32-x86-multi-thread. Binary build 822 [280952] provided by ActiveState. </span>

My problem is i want to use the GD::Simple module. I got the GD module for windows from ppm install http://theoryx5.uwinnipeg.ca/ppms/GD.ppd

Everything looked fine. I copied an example script from http://search.cpan.org/dist/GD/GD/Simple.pm and did a syntax check and everything was fine. When I run the script all I get is nonsense though. I tried outputting to *.png file instead, but the file is corrupt. I then tried creating a GIF and a JPEG but I have the same problems.

This is driving me bonkers. What am I doing wrong here? Any help would be much appreciated.


KevinR
Veteran


Feb 6, 2008, 11:48 AM

Post #2 of 4 (4500 views)
Re: [ulysses31] Windows GD module creates corrupt png files [In reply to] Can't Post

post the code you have been using. It may be that you need to use binmode() on the filehandle the image file gets printed to.
-------------------------------------------------


ulysses31
New User

Feb 6, 2008, 2:40 PM

Post #3 of 4 (4498 views)
Re: [KevinR] Windows GD module creates corrupt png files [In reply to] Can't Post

Hi Kevin,
Thanks a million for the fast reply and the solution, you're a legend, binmode() did the trick, works perfectly :)

B.


KevinR
Veteran


Feb 6, 2008, 2:43 PM

Post #4 of 4 (4496 views)
Re: [ulysses31] Windows GD module creates corrupt png files [In reply to] Can't Post

good old binmode to the rescue Smile
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives