问题
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