Commit graph

32 commits

Author SHA1 Message Date
Gleb Pomykalov a14b44974d support resource limits 2021-04-10 12:36:40 +03:00
Nathan Fiedler 63f2bf6a12 Fix compiler warnings
cargo test passes
2020-05-21 08:40:16 -07:00
Nikola Pajkovsky 415ad30bd0 add negate_image() operation
Signed-off-by: Nikola Pajkovsky <nikola.pajkovsky@livesporttv.cz>
2020-05-21 12:07:47 +02:00
Daniel Rönnkvist 97d620beb8 Binding for MagickClutImage 2020-03-25 14:29:52 +01:00
Daniel Rönnkvist 7d805d9a83 Binding for MagickSetSize 2020-03-25 14:26:41 +01:00
Nathan Fiedler 66397e6abc Fix deprecated usage of ONCE_INIT
Once::new() was added in Rust 1.2.0 and ONCE_INIT has been deprecated as of
Rust 1.38. Also updated the README example.

cargo test passes
2019-10-31 08:45:46 -07:00
Atul Bhosale f286c631b9
Format code using 'cargo fmt' 2019-08-17 21:48:01 +05:30
Magic Len 089e6fcb90 Binding for set_background_color 2019-05-29 15:03:17 +08:00
Nathan Fiedler bd34f145a2 Ran cargo fmt on the code base, looks better
cargo test passes
2018-10-06 15:38:33 -07:00
Nathan Fiedler 8a4fced836 Update to latest release of bindgen
Note that all of the enum definitions changed (again?), and now they are
flattened into the 'bindings' namespace. This breaks the API in a way that
is relatively easy to fix, albeit annoying. Attempts to change the enum
generation using default_enum_style() resulted in endless compiler errors.

cargo test passes
2018-10-06 15:37:41 -07:00
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