Fix ImageModel missing :data option key #149
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is intended to fix the issue #131 and may be a duplicate of #132 by @yholkamp (I noticed that PR after the fix), but it:
ImageModel#relationship_target
, which is only used to retrieve the file extensionIt also relates to issue #27 in a way that even after this fix there's no actual possibility to create a non-corrupted image from Base64 data:
The
read
method that's used with theFile
object when no:data
was supplied returns binary data, notBase64
-encoded.Similarly, if you do pass :data to the
img
method, it has to be binary, too, and you'll get nice and valid resulting image:With all that said, I guess that caracal-example has to be updated:
I don't mind taking care of it after this PR is merged.