通过 ODBC 从 Sybase 图像数据类型显示部分图像

发布于 2024-11-27 21:47:02 字数 1228 浏览 2 评论 0原文

昨天我一整天都在为此苦苦挣扎,但无法探究到底。

我有一个现有的数据库,我试图从中检索图像(我知道图像存储很大,但这就是我所坚持的)。我能够查询适当的数据库字段并获取数据,但是当我显示它时,似乎只显示了部分数据。

我正在使用此代码来显示图像:

require_once('../odbc_config.php');
if((isset($_GET['ur'])) AND ($_GET['ur'] != "")) {
    $aria_query1_ur = $_GET['ur'];
    $aria_query1 = "SELECT * FROM Patient WHERE PatientId='$aria_query1_ur' ";
    $patient_result = odbc_exec($aria,$aria_query1) or die("Error getting Patient Data");
    $patient_data = odbc_fetch_array($patient_result);
    }
$ID=$patient_data['PatientSer'];
$query = odbc_exec($aria, "SELECT * FROM Photo WHERE PatientSer=".$ID);
$row = odbc_fetch_array($query);
$content = $row['Picture'];
header('Content-type: image/jpeg');
echo $content;

我像这样调用此代码:

echo '<img src="contents/image2.php?ur='.$_GET['ur'].'">';

不幸的是,我似乎只能部分显示图像。图像的尺寸被正确读取,我可以从顶部看到前 50 x 480 左右的像素,但之后我看到的只是 640 x 480 像素的灰色背景。

像这样: http://i1218.photobucket.com/albums/dd411/Barbs_ldsr/stuff /th_partial_image.jpg

Sybase ODBC 驱动程序是否可能只允许一定数量的数据通过?我该如何检查或解决这个问题?还是PHP有问题?

任何帮助表示赞赏。 谢谢

I have been struggling with this all day yesterday but can't get to the bottom of it.

I have an existing database that I am trying to retrieve an image from (I know image storing is bulky but it's what I'm stuck with). I am able to query the appropriate database field and get the data out but when I display it, it seems like only part of the data is being displayed.

I am using this code to display the image:

require_once('../odbc_config.php');
if((isset($_GET['ur'])) AND ($_GET['ur'] != "")) {
    $aria_query1_ur = $_GET['ur'];
    $aria_query1 = "SELECT * FROM Patient WHERE PatientId='$aria_query1_ur' ";
    $patient_result = odbc_exec($aria,$aria_query1) or die("Error getting Patient Data");
    $patient_data = odbc_fetch_array($patient_result);
    }
$ID=$patient_data['PatientSer'];
$query = odbc_exec($aria, "SELECT * FROM Photo WHERE PatientSer=".$ID);
$row = odbc_fetch_array($query);
$content = $row['Picture'];
header('Content-type: image/jpeg');
echo $content;

I am calling this code like this:

echo '<img src="contents/image2.php?ur='.$_GET['ur'].'">';

Unfortunately I only seem to be able to display the image partially. The dimensions of the image are correctly read and I can see the first 50 x 480 or so pixels from the top but after that all I see is a gray background of 640 x 480 pixels.

Like this:
http://i1218.photobucket.com/albums/dd411/Barbs_ldsr/stuff/th_partial_image.jpg

Is it possible the Sybase ODBC driver is only allowing a certain amount of data through? How would I check or fix this? Or is there a problem with the PHP?

Any help appreciated.
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白首有我共你 2024-12-04 21:47:02

我评论说我们问题的解决方案与 php.ini 解决它的有限文本编辑有关。查找下一行。
odbc.defaultlrl = 4096
仅放大例如值
odbc.defaultlrl = 40960000
现在整个画面就留给你了。我希望对您有所帮助,并且我们将答案放在保姆询问的论坛中,当其他人遇到此问题时将解决这个问题

I commented the solution to our problem has to do with the limited text editing the php.ini solves it. Finds the next row.
odbc.defaultlrl = 4096
Only enlarges the value for example
odbc.defaultlrl = 40960000
and now with this whole picture leaves you. I hope will be of your help and cuerdate we put the answer in the forums where nannies asked for when someone else runs into this will solve

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文