【发布时间】:2012-01-28 05:28:08
【问题描述】:
我正在用 Rails 3.0.11 和 MiniMagick 编写一个小照片库。
def JadeImage.rescale path,new_path,max_height=150
image = MiniMagick::Image.open(path)
image.adaptive_resize(self.resize(image[:height],max_height))if image[:height] > max_height
image.write(new_path)
end
我正在使用它来保存同一张照片中的两张调整大小的图像。其中一个文件以 644 权限保存,一切正常。另一个总是保存为 600,因此无法在网页中显示。
现在,在保存它们之后,我运行一个小实用程序将该目录中的所有内容设置为 644,这样它现在就可以工作了。
有什么原因会发生这种情况吗?
【问题讨论】:
标签: ruby-on-rails-3 filesystems imagemagick minimagick