Forum Moderators: coopster
-----------
$image = @imagecreatefromjpeg($filename);
if ($image === false) { die ('Unable to open image'); }
$height = imagesy($image);
$width = imagesx($image);
$bmpdest = "../bmp/" . $rand . ".bmp";
$bmp = jpeg2wbmp($filename, $bmpdest, 100, 100, 4);
-----------
It's creating the bmp image and everything, but once the .bmp is downloaded, when trying to open, it returns an error about an invalid image file..
Anyone able to shed some light?
$bmpdest = "../bmp/" . $rand . ".bmp";
$bmp = jpeg2wbmp($filename, $bmpdest, 100, 100, 4);
the only probs that it looks like it could be are
1. destination not writable
2. GD library not up to date
3. Set the filetype to .wbmp
($bmpdest = "../bmp/" . $rand . ".wbmp";)
PHP does not have native support for BMP files. The comments on the imagecreatefromwbmp [php.net] manual page may be helpful. :)
require_once('phpthumb.functions.php');
require_once('phpthumb.bmp.php');
$filename = $_GET['file'];
$jpg = imagecreatefromjpeg($filename);
$phpbmp = new phpthumb_bmp();
$location = "../bmp/" . $rand . ".bmp";
file_put_contents($location, $phpbmp->GD2BMPstring($jpg));
Ye, WBMP creates a mono WAP style bmp file, not readable by Windows.
[edited by: PhaZZed at 2:43 pm (utc) on Aug. 13, 2007]