From:             hyperila at hotmail dot com
Operating system: windows xp
PHP version:      5.0.5
PHP Bug Type:     GD related
Bug description:  imagejpeg does not save image

Description:
------------
Hi i have started using imagejpeg function from GD. However, when i
produce the following code: <see below>

It did not give save and overwrite my working image to a new image with a
new size. please help me in this. Thanks

Reproduce code:
---------------
<?php
// The file
$filename = 'wew.jpg';

// Content type
header('Content-type: image/jpeg');

// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = 10;
$new_height = 10;

// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height,
$width, $height);

// Output

imagejpeg($image_p);
?> 

Expected result:
----------------
I expected to see my file : "wew.jpg" to be of size 10 x 10 pixels.

I realised that after trying my script for many times, i managed to get
the file overwritten. It became a file of the same filename but of a new
assigned size (10 x 10).

Please help as i don't seem to make it work again.

Actual result:
--------------
Actual result is that the browser did show me the small (10x10) picture
but the real wew.jpeg is still untouched. I want it to be affected by the
php code.

-- 
Edit bug report at http://bugs.php.net/?id=35265&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=35265&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=35265&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=35265&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=35265&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=35265&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=35265&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=35265&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=35265&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=35265&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=35265&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=35265&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=35265&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=35265&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=35265&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=35265&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=35265&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=35265&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=35265&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=35265&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=35265&r=mysqlcfg

Reply via email to