我正在使用carrierwave
和mini_magick
宝石来使用rails_admin
内的图片。当我上传图片时,它会因此错误而失败:
Failed to manipulate with MiniMagick, maybe it is not an image?
Original Error: `identify C:/Users/Zeke/AppData/Local/Temp/mini_magick20161027-21132-xdongz.png` failed with error:
identify.exe: RegistryKeyLookupFailed `CoderModulesPath' @ error/module.c/GetMagickModulePath/662.
identify.exe: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/501.
当我在uploader.rb
# Process files as they are uploaded:
process resize_to_fit: [800, 600]
# Create different versions of your uploaded files:
version :thumb do
process resize_to_fill: [40, 30]
end
我需要缩略图,我该怎么做?
以下是我的确定:
identify C:/Users/Zeke/AppData/Local/Temp/mini_magick20161027-21132-xdongz.png
在cmd
中运行时成功执行(没有admin priv,如果这很重要) identify -list format
提供了一个 huuuuge 列表,几乎包含了我能想到的每种图像格式。是的,它包括JPG
,JPEG
,PNG
以及我需要的一切。convert -version
确实包含 jpeg png 代表 我做错了什么?
答案 0 :(得分:0)
我测试的identify
和convert
工作正常,但他们实际上并未被rails
使用,而imagemagick
使用了translation missing
{1}}这是非常陈旧的,我首先提出了这个en.yml
错误,我通过在cmd
值得注意的是 系统环境变量 可以被 设置路径 覆盖,只能持续很长时间
ImageMagick
的实例
让rails使用新版本的if ($This_Address == '') {
$new_This_Address = ""; }
else {
$new_This_Address = " 
 this time: $This_Address";
}
?>
<html>
<head>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<form name="editTask" action="task_show_full.php" method="POST">
<input type="hidden" name="T_ID" value="<?php echo $T_ID; ?>"/>
<input type="hidden" name="Cust_ID" value="<?php echo $Cust_ID; ?>"/>
<input type="submit" class="taskbutton" style="width:350px" name="showTask"
value="<?php echo "ID: ", $T_ID, ", ", "customer-ID: ", $Cust_ID, ", ", "User: ", $User;
?> 
 <?php echo $newFlat, $House, " ", $Street, ", ", $Town, ", ", $Postcode;
echo $new_This_Address;
?> 
 <?php echo $Display_Task_Date, " ", $Task; ?> 
 <?php
echo $Price_Today, " ";
?>"/>
</form>
<?php
解决了这个问题。
积分:Mark Setchell