我在模特中做这些
def self.get_store_resize_image(filename, store_id)
filename=filename.gsub(' ', '%20')
image = MiniMagick::Image.open(filename) #getting error here
image.resize "252x185" ## The thumbnail size
temp_file_name="#{Time.now.to_time.to_i}_#{store_id}"
@store_image_path="#{Rails.root}/public/tmp/#{temp_file_name}.png"
@store_image="/tmp/#{temp_file_name}.png"
image.write(@store_image_path)
return @store_image
end
如何将“\ xFF”从ASCII-8BIT修复为UTF-8错误?