我正在用 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,这样它现在就可以工作了。
有什么理由会发生这种情况吗?