避免未找到JPEG标记!&“错误”

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了避免未找到JPEG标记!&“错误”相关的知识,希望对你有一定的参考价值。

If you get "JPEG marker not found!" error when you try to open an image file you must read it in binary mode.
  1. <%
  2.  
  3. my_file = File.open("image.jpg", "rb") {|f| f.read}
  4. img = ImageSize.new( my_file )
  5.  
  6.  
  7. # Testing: get img width with image_size lib.
  8.  
  9. img_witdh = img.get_width
  10.  
  11. %>

以上是关于避免未找到JPEG标记!&“错误”的主要内容,如果未能解决你的问题,请参考以下文章