2014-02-05 08:43
浏览 180

PHP imagick_writeImage无法写入图像

I need to convert .dcom pictures into .jpg picture for printing, So I have path to .dcom files in my DB, but I have trouble with writing .jpg image into folder... Here is the code how I am trying to save .jpg picture

$test = imagick_readimage('V:\PACS\DCM\USMFD3\2014\02\04\1.2.840.113663.1500.1.295897643.3.1.20140204.74935.437');
imagick_writeimage($test, 'img\1.2.840.113663.1500.1.295897643.3.1.20140204.74935.437.jpg')

but when I am trying to var_dump(imagick_writeimage($test, 'img\1.2.840.113663.1500.1.295897643.3.1.20140204.74935.437.jpg')); I get bool(false)

UPDATE1: here is var_dump of $test - resource(1) of type (imagick handle)

So what I am doing wrong?

P.S If you need more code to see, please write a coment, and I will update my question

图片转代码服务由CSDN问答提供 功能建议

我需要将 .dcom 图片转换为 .jpg 用于打印的图片,所以我在我的数据库中有.dcom文件的路径,但我将.jpg图像写入文件夹时遇到问题... 这是代码我如何保存 .jpg 图片

  $ test = imagick_readimage('V:\ PACS \ DCM \ USMFD3 \ 2014 \ 02 \ 04 \ 1.2.840.113663.1500.1.295897643.3.1.20140204.74935.437');  
imagick_writeimage($ test,'img \ 1.2.840.113663.1500.1.295897643.3.1.20140204.74935.437.jpg')

但是当我尝试 var_dump(imagick_writeimage($ test,'img \ 1.2.840.113663.1500.1.295897643.3.1.20140204.74935.437.jpg')); 我得 bool(false)

UPDATE1:这里是 $ test var_dump - 资源(1)类型(imagick句柄)


PS如果你需要更多的代码来看,请写一篇文章,我会更新我的 问题

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongxianji0968 2014-02-05 08:49

    It's only a guess, but i think you web server is not allowed to write to there. Are you sure that the readimage works?

    Your path V looking like a windows mapped network drive. Maybe you webserver-process doesn't have that mapped drive.

    I could be also a problem with the relative path in writeimage. This could be: \img. Normally "c:\programm files*" where no write access is allowed.

    解决 无用
    打赏 举报

相关推荐 更多相似问题