我需要将DCOM映像转换成JPG映像,我使用的是来自本站的本站。但我无法将转换后的图像保存在我的var_dump()中。答复如下:
object(dicom_convert)#1 (5) {
["file"] => string(62) "img/dcom/1.2.826.0.1.3680043.2.634.0.12779.2012316.9235.11.dcm"
["jpg_file"] => string(66) "img/dcom/1.2.826.0.1.3680043.2.634.0.12779.2012316.9235.11.dcm.jpg"
["tn_file"] => string(69) "img/dcom/1.2.826.0.1.3680043.2.634.0.12779.2012316.9235.11.dcm_tn.jpg"
["jpg_quality"] => int(100)
["tn_size"] => int(125)
}因此,据我所知,在jpg_file中,我保存了(?)JPG图像,还是不?如果没有,我怎样才能拯救它呢?
因为如果我用
$jpg = imagecreatefromjpeg('http://localhost/'.$d->jpg_file);
imagejpeg($jpg, NULL);`我犯了个错误
Warning: imagecreatefromjpeg(http://localhost/img/dcom/1.2.826.0.1.3680043.2.634.0.12779.2012316.9235.11.dcm.jpg) [function.imagecreatefromjpeg]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in O:\home\localhost\www\dcm_to_jpg.php on line 29
Warning: imagejpeg(): supplied argument is not a valid Image resource in O:\home\snimki\www\dcm_to_jpg.php on line 30有人能停下来回答我的问题吗?
UPD1:
好的,正如我所看到的,我无法保存转换的图像,所以我无法访问不存在的文件.所以我有第二个问题,谁能帮我保存我从class_dicom.php类得到的转换成的JPG图片.我只是找不到保存文件的功能.
发布于 2014-01-20 14:20:02
试试这个吧。
header("Content-type: image/jpeg");
echo file_get_contents($imgPath); //$imgPath -> img/dcom/1.2.826.0.1.3680043.2.634.0.12779.2012316.9235.11.dcm_tn.jpghttps://stackoverflow.com/questions/21236221
复制相似问题