php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18964 ibase_blob_import problem
Submitted: 2002-08-19 08:50 UTC Modified: 2003-08-16 11:38 UTC
From: keltic at inbox dot ru Assigned:
Status: Not a bug Package: InterBase related
PHP Version: 4.2.2 OS: WIN 2000 Pro
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: keltic at inbox dot ru
New email:
PHP Version: OS:

 

 [2002-08-19 08:50 UTC] keltic at inbox dot ru
ibase_blob_import() import correctly BMP images only. It doesn't support other image formats as GIF, JPEG, TIFF etc, specified in InterBase manual. AVI and MOV videos not support too, didn't test the sound and others BLOB objects.
Best Regards, Eugene Kinyapin  

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-19 08:52 UTC] keltic at inbox dot ru
ibase_blob_import() import correctly BMP images only. It doesn't support
other image formats as GIF, JPEG, TIFF etc, specified in InterBase
manual. AVI and MOV videos not supported too, didn't test the sound and
others BLOB objects.
Best Regards, Eugene Kinyapin
 [2002-08-19 09:20 UTC] sander@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.



 [2002-08-19 10:22 UTC] keltic at inbox dot ru
<?php
$db = ibase_connect("localhost:c:\db.gdb", "user", "password");
$filename = "c:\\image.bmp";
$fp = fopen ($filename, "r");
$blob_id_str = ibase_blob_import($fp);
ibase_blob_echo($blob_id_str);
/*inserting to the database*/
?>
if BMP image all is OK, but if i want import any other format as gif, jpeg, etc (see previous) it's echo the string, not picture. And it's inserting wrong data to the database. 
Database error messages: Unable to display blob. The format is not graphical. (for all types - gif, jpg, tif, png)
Detail message:
1)Bitmap image is not valid (except png);
2)Stream read error(for png)
 [2002-08-19 10:32 UTC] keltic at inbox dot ru
//inserting to the database
$blob_id_str = ibase_blob_import($fp);
$q1 = "insert into table1 values(1, ?)";
$r1 = ibase_query($db, $q1, $blob_id_str);
 [2002-08-19 16:32 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip


 [2002-08-21 11:43 UTC] keltic at inbox dot ru
what kind of info do you need? please tell me particularly.
 [2002-08-21 20:27 UTC] sniper@php.net
Please try using this CVS snapshot:

http://snaps.php.net/win32/php4-win32-latest.zip

 [2002-08-24 06:43 UTC] keltic at inbox dot ru
CVS snapshot works worse then php 4.2.2
Database error messages: Unable to display blob. The format is not graphical. (for all types - BMP, gif, jpg, tif)
Detail message:
Stream read error(for all types)
 [2002-08-30 10:29 UTC] keltic at inbox dot ru
InterBase manual quotation:
How are Blob data stored?
Blob is the InterBase datatype that represents various objects, such as bitmapped images, sound, video, and text. Before you store these items in the database, you create or manage them as platform- or product-specific files or data structures, such as:
1)TIFF, PICT, BMP, WMF, GEM, TARGA or other bitmapped or vector-graphic files.
2)MIDI or WAV sound files.
3)Audio Video Interleaved format (.AVI ) or QuickTime video files.
4)ASCII, MIF, DOC, RTF, WPx or other text files.
5)CAD files.
You must load these files from memory into the database programmatically, as you do any other host-language data items or records you intend to store in InterBase.

4.2.2 release news quatation:
1)Better Interbase blob, null and error handling. (Patch by Jeremy Bettis)
2)Added Win32 project for the Interbase module (Zeev)
3)Ported InterBase module finally from PHP 3 to PHP 4. Full support for   InterBase 6. (Jouni)
 [2002-10-01 04:05 UTC] wez@php.net
Always(!) use "rb" when fopening binary files under Windows.
Does this resolve the problem??
 [2002-10-01 04:10 UTC] wez@php.net
Let me clarify that:
Dont use:
  fopen ($filename, "r");
use this instead
  fopen ($filename, "rb");

 [2002-10-20 23:18 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-08-16 11:38 UTC] abies@php.net
Interbase doesn't *display* BLOBs, only store them. There's no way Interbase will complain about a format 'not being graphical'
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC