dongtuo3530 2012-05-15 12:50
浏览 30
已采纳

Image Magick创建缩略图

Hi i am creating a thumbnail using imagemagick by following command

 convert -define jpeg:size=".$this->info[0]."x".$this->info[1]."  testi/".$this->filename."  -auto-orient  -thumbnail 200x200   -unsharp 0x.5 testi/".$this->filename

but this command only runs for jpack input file.

Can anyone tell me the command for any file type? like if gif then output shuld gif ?

  • 写回答

2条回答 默认 最新

  • duanjianqu3685 2012-05-15 15:45
    关注

    What is a jpack file?

    The -define will only work for jpg files but I thought if the output file was not a jpg it would be ignored; try removing that.

    The output file should be the same name as the input file.

    Try writing your code like this so you can see what the command actualy is; you can comment the echo out when its working.

    $cmd = "-define jpeg:size={$this->info[0]}x{$this->info[1]}  testi/{$this->filename}  -auto-orient -thumbnail 200x200 -unsharp 0x.5 testi/{$this->filename}"; 
    echo $cmd;
    exec("convert $cmd");
    

    I got a bit lost with the "$this->" business and so the code may not work as written. I try and keep things simple in my commands and would have put the filenames etc. into a variable outside the Imagemagick command.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大