![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| An image gallery script that worked with earlier versions of PHP started generating this message once we upgraded to 4.3.*. --I've tried installing everything from 4.3.1 to RC2 of 4.3.3, and they all have the same problem. Has something changed in the way PHP handles jpegs? Can someone point to the error in the script below? Any and all help would be appreciated My php configure options include gd and jpeg libraries: [ --with-mysql=/etc/mysql --with-xml --with-apache=../apache_1.3.28 --enable-track-vars --with-gd --with-zlib-dir=/usr/local --with-jpeg-dir=/usr --with-png=/usr/local --with-curl=/usr/local --with-openssl=/etc/ssl --with-swf=usr/local ] Also, <? var_dump(gd_info()); ?> shows this: array(10) { ["GD Version"]=> string(27) "bundled (2.0.15 compatible)" ["FreeType Support"]=> bool(false) ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(false) ["JPG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XBM Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) } The part of the script that's causing problems is below: ================================================== == $today=date("dmy"); $image_name = $today . "_" . $image_name; $destination ="./images/" . $image_name; $thumbnail = "./images/thumb_" . $image_name; $MAX_WIDTH = 175; $MAX_HEIGHT = 150; if (is_uploaded_file($HTTP_POST_FILES['image']['tmp_n ame'])) { copy($HTTP_POST_FILES['image']['tmp_name'], "./images/" . $image_name); } else { echo "Well, that didn't work"; } $thumb = ImageCreateFromJPEG($destination); if (!$thumb) { echo "oops, didn't work!"; } else { $size = GetImageSize($destination); if (($size[0] / $size[1]) > ($MAX_WIDTH / $MAX_HEIGHT)) $modifier = $MAX_WIDTH / $size[0]; else $modifier = $MAX_HEIGHT / $size[1]; $image_copy = @imagecreatefromjpeg ($destination); $thumbnail_memory = @ImageCreate ($size[0] * $modifier, $size[1] * $modifier); imagecopyresized ($thumbnail_memory, $image_copy, 0, 0, 0, 0, $size[0] * $modifier, $size[1] * $modifier, $size[0], $size[1]); imagejpeg ($thumbnail_memory, $thumbnail); ================================================== == This last line is where the script dies with the error: imagejpeg(): gd-jpeg: JPEG library reports unrecoverable error. Any thoughts or assistance with this would be greatly appreciated! Even have tried configuring PHP after installing GD manually, and then adding the parent directory of GD to the configure script just in case that was the issue. Thanks! | |||
| Featured Websites | ||||
|
![]() |
| Tags: error, jpeg, library, reports, unrecoverable |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Which C(++) Library should I use for Sprite Programming? | PC HUA | Software Programming | 4 | 06-12-2007 11:28 PM |
| found new ( old) network library project | Serge Kourdakov | Software Programming | 1 | 06-12-2007 11:28 PM |
| Get a FREE Money-Making ebook Library! | verdeneon@gmail.com | Affiliate Programs | 0 | 06-12-2007 8:17 PM |
| FA: Early Church Fathers Library CD | KwikMind Software | Ebay Technical Questions | 0 | 05-31-2007 12:37 AM |
| Featured Websites | ||||
|