Commit graph

22 commits

Author SHA1 Message Date
Magic Len fd8f5e49a2 Binding for set_image_background_color 2018-08-12 23:05:45 +08:00
Nathan Fiedler 82dd58b726 Image colors value has some variability
cargo test passes
2018-02-16 09:51:20 -08:00
little-bobby-tables ddd33809e3 test new functionality 2018-01-03 17:05:22 +07:00
little-bobby-tables f6c55ba836 add get_image_page to MagickWand
get_image_page (MagickGetImagePage) is especially useful
for determining the overall dimensions of a GIF, which may have
frames with different widths and heights. In such cases,
get_image_width and get_image_height report the dimensions of
the last frame only.
2017-08-23 19:37:38 +07:00
little-bobby-tables 7abde0e7c6 resolve initial compilation issues 2017-08-19 16:35:58 +07:00
gentoo90 c50b3e27de Add compare_images method 2017-05-16 16:43:08 +03:00
Nathan Fiedler e7054d3e35 Use the rust-bindgen crate properly
Using the changes from @gadomski along with some additional work, to get the
generated bindings working again. Works on macOS and FreeBSD 11. A couple of
hacks are needed for FreeBSD, but nothing too serious.

Changed to use the libc prefix, and changed to use the generated enums.

Fixes #22, #15, and #14

cargo test passes
2017-04-08 16:03:58 -07:00
Nathan Fiedler f4843c246c Test with some flexibility in image size
The size of the image can vary from version to version (of ImageMagick) and
platform to platform (i.e. MacOS and FreeBSD). As such, allow for a degree
of variability in the resulting image size.

cargo test passes
2017-01-22 14:13:05 -08:00
Nathan Fiedler 7a5bd98746 Merge pull request #13 from gadomski/set-option
Add `set_option` method.
2016-08-03 20:34:21 -07:00
Pete Gadomski eeb014af1f Add set_option method.
This is useful for stuff like setting the loop option for a gif.
2016-08-02 12:01:34 -06:00
Pete Gadomski b46f8a47ac Add write_images_blob
This method goes down to `MagickGetImagesBlob`, which allows for
creating animated gifs.

I didn't abstract out common operations between the two in the interest
of not overly polluting the codebase. However, this new method is almost
identical to `write_image_blob` so you could probably abstract something
out of there.
2016-08-02 11:35:16 -06:00
Nathan Fiedler 731025764d Fix the tests after the API change 2016-06-25 15:39:36 -07:00
Nathan Fiedler a5cb97d3cf Correct the rotated image to match expectations
The test image that was meant to be rotated was generated incorrectly.
It now corresponds to the following ImageMagick command:

$ convert in -rotate 90 -orient left-bottom out

cargo test passes
2016-03-29 20:56:58 -07:00
Nathan Fiedler faebc468ba Detect and correct non-optimal image orientation
cargo test passes
2016-03-29 18:28:33 -07:00
Nathan Fiedler f115a7a774 Tests now pass on Mac OS X, Ubuntu Linux, and FreeBSD 2016-02-10 17:41:17 -08:00
Nathan Fiedler 61033dbb94 Use cfg! so test passes on FreeBSD 2016-02-03 21:08:02 -08:00
Nathan Fiedler 34c4fec9fe Use canonical tag name for original date 2016-01-02 20:47:38 -08:00
Nathan Fiedler 19377db422 Add get_image_property() to retrieve properties
cargo test passes
2016-01-02 14:31:20 -08:00
Nathan Fiedler 5e091bf488 Add a fit function to resize an image
Given a bounding box defined by the desired width and height, resize the
image to fit that box, maintaining the aspect ratio.

cargo test passes
2015-06-10 21:27:58 -07:00
Nathan Fiedler 56877aaad3 Write image to a vector of bytes (in memory write)
cargo test passes
2015-06-09 22:18:57 -07:00
Nathan Fiedler 78d681608d Read image data from a vector of bytes
cargo test passes
2015-06-09 06:57:56 -07:00
Nathan Fiedler 1781b39863 Basic API in place, some tests working
Reading an image, getting its dimensions, and resizing are working.

cargo test passes
2015-06-08 21:47:17 -07:00