php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20096 Call to undefined function: imagecopyresampled()
Submitted: 2002-10-25 14:22 UTC Modified: 2002-10-26 21:18 UTC
From: kevincarlson at houston dot rr dot com Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.3.0-pre1 OS: Slackware Linux 8.0/8.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kevincarlson at houston dot rr dot com
New email:
PHP Version: OS:

 

 [2002-10-25 14:22 UTC] kevincarlson at houston dot rr dot com
$im = @imagecreatefromjpeg ($imgname); 			    
if ($im==""):
  echo "Error opening $imgname<br>";
else:
  $th_im =  @imagecreate (100, 100);
  $a = imagecopyresampled ($th_im, $im, 0, 0, 0, 0, 100, 100, imagesx($im), imagesy($im));
endif;

header("Content-type: image/jpeg");
imagejpeg ( $th_im );
imagedestroy($im);

Configured php with:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr --with-zlib --with-bz2 --enable-trans-sid --with-mcrypt --enable-exif --with-gd --with-jpeg-dir=/usr/lib

The thing is that I've removed all prior installations of gd from my system, and am using the gd extension packaged with php.  The imagecopyresized function works just fine.

suggestions?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-25 14:35 UTC] sander@php.net
If you configured 4.3.0-pre1 with the argument --with-gd, then PHP does not use the bundled libs. Any version after 4.3.0-pre1 will use the bundled libs by default, unless you specify a path to gd.
Please try to configure 4.3.0-pre1 with the argument --with-gd=php or try a snapshot from http://snaps.php.net and configure with --with-gd.
 [2002-10-25 15:10 UTC] sniper@php.net
Also --with-jpeg-dir=/usr/lib is incorrect. Correct option would be --with-jpeg-dir=/usr 

And there's no bug here.

 [2002-10-25 17:48 UTC] kevincarlson at houston dot rr dot com
I used '--with-gd=php' as suggested, and the functions:
imagecopyresampled()  and
imagecreatetruecolor()  both do not work.  

If I recall correctly, '--with-gd=php' also complained of a lack of a libgd.(a|so) file as well.

I've tried '--with-jpeg-dir=/usr' and '--with-jpeg-dir=/usr/lib' both.  I don't see any errors associated with the jpeg6b library tho, always gd.

I'm dizzy from the recompiling ;-)  But I'll try again later.  Thanks for the tips guys.
 [2002-10-26 21:18 UTC] kevincarlson at houston dot rr dot com
Me again.  Problem fixed, but not solved.

I installed Slackware 8.1 from scratch.  A fresh installation of php-4.3.0pre1 now produces the functions that were missing before using:

rm config.cache; \
./configure \
--with-apxs2=/usr/local/apache2/bin/apxs  \
--with-mysql=/usr \
--with-zlib \
--with-bz2=php \
--enable-trans-sid \
--enable-exif \
--with-gd=php \
--with-jpeg-dir=/usr \
--with-png-dir=/usr 

After making and installing the function:
print_r (get_extension_funcs ("gd"));    
- shows 72 functions.

On my old installation, the same thing produced only 56 functions. (w/ imagecopyresampled() and imagecreatetruecolor() being among the missing 0

So the problem is fixed, but I do not know what was wrong with my OS that made this so difficult.

If anyone has any ideas to solve this, feel free to suggest and I'll check logfiles etc.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 03:01:29 2024 UTC