php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13625 fwrite writes more data to file than in output string
Submitted: 2001-10-10 05:46 UTC Modified: 2001-10-10 06:54 UTC
From: jayp at clear dot net dot nz Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.0.6 OS: W2K
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: jayp at clear dot net dot nz
New email:
PHP Version: OS:

 

 [2001-10-10 05:46 UTC] jayp at clear dot net dot nz
I gave a SQL DB with GIF data field. f.ex there are 2*27006 bytes in there (hex strings). I can retrieve them without any problems but when I do

  $fp = fopen($fn, 'wb');
  $Bin = ConvertToBinary($GIFString);
  $BlockLength=strlen($Bin);
  set_file_buffer($fp, 0);
  fwrite($fp,$Bin);  
  fclose($fp);

$GIFString has the correct size of 2*27006,
$Bin has the correct binary size of 27006.

But the file has the size of 27176 bytes. I have no idea where the addiotnal 170 bytes are coming from (doesn't help when add the $BlockLength to fwrite). After 0x363 there is a 1 byte shift etc...

regards
Jay

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-10 06:54 UTC] derick@php.net
Bogus but it was added twice.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC