Ruby VIPS image.write_to_memory yields different results in different environments

做~自己de王妃 提交于 2019-12-13 20:17:10

问题


We need to open an image and write its pixels to memory, so a C library can further process it. We're doing this with the lines below:

image = Vips::Image.new_from_file(filename)
pixels_pointer = image.write_to_memory

However, it seems that what's written in memory differs per environment. We're testing this on a macOS High Sierra and on an Ubuntu Xenial via Docker, with vips-8.8.0 and ruby-vips (2.0.13). We've MD5-ed the result of writing to memory:

p Digest::MD5.hexdigest(pixels_pointer)

and here are the outcomes for both:

  • macOS High Sierra: 141e9b6a84f4ca05a7699b33fc0ef808
  • Ubuntu Xenial via Docker: 019a568e40dcc41ac6496da06d29d723

I have no clue why this is happening and where shall I look further. Any tip would be highly appreciated!

来源:https://stackoverflow.com/questions/56327073/ruby-vips-image-write-to-memory-yields-different-results-in-different-environmen

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!