Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
seg fault using perl GD module
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
BodOrange
Tux's lil' helper
Tux's lil' helper


Joined: 05 Apr 2003
Posts: 132

PostPosted: Thu May 29, 2003 11:39 am    Post subject: seg fault using perl GD module Reply with quote

When trying to create a new GD image from an existing file I get a segmentation fault. I've tried various constructors and image formats, but always the same error.

Code:
#!/usr/bin/perl -w
use strict;
use GD;

open IN, 'image.jpg'  or die "Could not open.";
my $srcImage = GD::Image->newFromJpeg(*IN);
close IN;

my $srcImage2 = GD::Image->newFromJpeg('image.jpg');

my $srcImage3 = GD::Image->new('image.png');


I used strace but do not know enough to make use of the output. The last (hopefully pertinent) lines are:

Code:
open("image.png", O_RDONLY|O_LARGEFILE) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE, 0xbffff0d0) = -1 EINVAL (Invalid argument)
_llseek(3, 0, [0], SEEK_CUR)            = 0
fstat64(3, {st_mode=S_IFREG|0744, st_size=4234, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
read(3, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0@\0\0\0@\10\3\0\0\0\235"..., 4096) = 4096
_llseek(3, 4, [4], SEEK_SET)            = 0
_llseek(3, 0, [4], SEEK_CUR)            = 0
_llseek(3, 0, [0], SEEK_SET)            = 0
_llseek(3, 0, [0], SEEK_CUR)            = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++


I'm using
libgd-1.8.3-r6
GD-1.32-r3
perl-5.8.0-r10

Any help would be much appreciated.
thx
Back to top
View user's profile Send private message
BodOrange
Tux's lil' helper
Tux's lil' helper


Joined: 05 Apr 2003
Posts: 132

PostPosted: Fri May 30, 2003 3:18 pm    Post subject: Reply with quote

I just tried php as it also uses GD to manipulate images. I tried a simple php script.
Code:

$filename=$argv[1];
$thumb_file=$argv[2];
$src_img = imagecreatefromjpeg($filename);
$dst_img = imagecreate(80,60);
imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, 80, 60, 320, 240);
imagejpeg($dst_img,$thumb_file,75);
imagedestroy($src_img);
imagedestroy($dst_img);


this runs ok, but the reultant images are high contrast and under saturated. This script, run on my debian box, produces colour jpegs fine.

Is there something wrong with libgd by any chance?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum