Re: Loading Images from PHP broken on Redhat Enterprise

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Curt,

In that case, what on earth is going on.  This is the script which is on both servers:  However, I noticed that if I moved the following lines to the top of the script:

header("Content-Type: image/jpeg");
header("Content-Transfer-Encoding: binary");

..and hard-code the mime type, it outputs the correct headers, apart from "
Transfer-Encoding:chunked".  Which seems to still screw it up.  The content length is wrong (13198), it should be 13184.  Looking at the RAW output of the image data, there is a difference.  I noticed 3381 was output as part of the image data, yet this is not so on the Server #1, that works.  Even if I fix the content-length header to what it should be, it still has some differences.

It still bugs me that the data is absolutely fine in the database, as I can save the data out of it into a file and view that file as an image with no problems at all.

Anything else you can think of?

Thanks,

Kevin

<?php
require('../classes/housekeeping.php');
$db_conn = new HOUSEKEEPING;
$limiteds = $db_conn->database();

require('../classes/categories.php');

if ( isset($_GET['image_id']) && isset($_GET['field_id']) && isset($_GET['mime_type']) )
{
    $image_info = new CATEGORY;
    $image_info->LINK = $limiteds;
    $image_info->IMAGE_ID = $_GET['image_id'];
    $image_info->FIELD_ID = $_GET['field_id'];
    $image_info->get_thumb_image();
   
    header("Content-Type: ".$_GET['mime_type']);
    header("Content-Transfer-Encoding: binary");
    header("Content-Length: ".strlen($image_info->IMAGE_THUMB));
    echo $image_info->IMAGE_THUMB;
}
elseif ( isset($_GET['image_id']) && isset($_GET['field_id'])  )
{
    $image_info = new CATEGORY;
    $image_info->LINK = $limiteds;
    $image_info->IMAGE_ID = $_GET['image_id'];
    $image_info->FIELD_ID = $_GET['field_id'];
    $image_info->get_thumb_image();
   
    header("Content-Type: $image_info->MIME_TYPE");
    header("Content-Transfer-Encoding: binary");
    header("Content-Length: ".strlen($image_info->IMAGE_THUMB));
    echo $image_info->IMAGE_THUMB;
}
?>


Curt Zirzow wrote:
On Wed, Nov 16, 2005 at 11:44:27PM +0000, Kevin Smith wrote:
HI Robert,

Server #1 (working)
http://www.limiteds.com/includes/image_load.php?image_id=8522&field_id=image_full_2

Headers for this one:
Content-Transfer-Encoding: binary
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
P3P: CP="NOI DSP COR NID CUR OUR NOR"
Content-Length: 12547
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: image/jpeg


Server #2 (sad and not working)
http://www.limitedshop.co.uk/includes/image_load.php?image_id=8522&field_id=image_full_2
 
And This one:
P3P: CP="NOI DSP COR NID CUR OUR NOR"
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=ISO-8859-1


Something is different.

Curt.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux