Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A lot of missing bytes when trying to write a bitmap to memory #13

Open
mtthwgry opened this issue Mar 9, 2016 · 6 comments
Open

A lot of missing bytes when trying to write a bitmap to memory #13

mtthwgry opened this issue Mar 9, 2016 · 6 comments

Comments

@mtthwgry
Copy link

mtthwgry commented Mar 9, 2016

memory = FreeImage::Memory.new
image = FreeImage::Bitmap.open(...)
memory.save(image, :jpeg)

memory.memory.bytes
# => "\xFF\xD8\xFF\xE0"

memory.memory.count
# => 1017134

memory.memory.size
# => 9223372036854775807

This returns a memory object that contains 4 bytes, but has what appears to be the correct bytes count.

If I try image.save(memory, :jpeg) I get the same result.

@mtthwgry
Copy link
Author

mtthwgry commented Mar 9, 2016

Also, the memory.format is :unknown even though I am specifying it.

@cfis
Copy link
Owner

cfis commented Mar 20, 2016

Hmm...any progress on tracking this down?

@mtthwgry
Copy link
Author

@cfis not yet...I am using MiniMagick at the moment, which is considerably slower...

cfis pushed a commit that referenced this issue Jun 1, 2016
@cfis
Copy link
Owner

cfis commented Jun 1, 2016

Had a chance to look at this, the method will now return the correct bytes.

@cfis
Copy link
Owner

cfis commented Jun 1, 2016

As well as the correct image type, see a71f529.

@mtthwgry
Copy link
Author

mtthwgry commented Jun 2, 2016

@cfis Thanks for the update! I'll check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants