Upgrade to libc 0.2.4
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "magick_rust"
|
name = "magick_rust"
|
||||||
version = "0.2.0"
|
version = "0.2.3"
|
||||||
authors = ["Nathan Fiedler <nathanfiedler@fastmail.fm>"]
|
authors = ["Nathan Fiedler <nathanfiedler@fastmail.fm>"]
|
||||||
description = "Selection of Rust bindings for the ImageMagick library."
|
description = "Selection of Rust bindings for the ImageMagick library."
|
||||||
homepage = "https://github.com/nlfiedler/magick-rust"
|
homepage = "https://github.com/nlfiedler/magick-rust"
|
||||||
@ -11,4 +11,4 @@ keywords = ["magickwand", "imagemagick"]
|
|||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.1.8"
|
libc = "0.2.4"
|
||||||
|
|||||||
@ -33,7 +33,7 @@ extern crate libc;
|
|||||||
|
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use libc::{c_uint, size_t, c_double, c_void};
|
use libc::{c_uint, c_double, c_void};
|
||||||
use filters::FilterType;
|
use filters::FilterType;
|
||||||
|
|
||||||
mod bindings;
|
mod bindings;
|
||||||
@ -107,7 +107,7 @@ impl MagickWand {
|
|||||||
filter: FilterType, blur_factor: f64) {
|
filter: FilterType, blur_factor: f64) {
|
||||||
unsafe {
|
unsafe {
|
||||||
bindings::MagickResizeImage(
|
bindings::MagickResizeImage(
|
||||||
self.wand, width as size_t, height as size_t,
|
self.wand, width as u64, height as u64,
|
||||||
filter as c_uint, blur_factor as c_double
|
filter as c_uint, blur_factor as c_double
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ impl MagickWand {
|
|||||||
unsafe {
|
unsafe {
|
||||||
bindings::MagickResetIterator(self.wand);
|
bindings::MagickResetIterator(self.wand);
|
||||||
while bindings::MagickNextImage(self.wand) != bindings::MagickFalse {
|
while bindings::MagickNextImage(self.wand) != bindings::MagickFalse {
|
||||||
bindings::MagickResizeImage(self.wand, new_width as size_t, new_height as size_t,
|
bindings::MagickResizeImage(self.wand, new_width as u64, new_height as u64,
|
||||||
FilterType::LanczosFilter as c_uint, 1.0);
|
FilterType::LanczosFilter as c_uint, 1.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -156,7 +156,7 @@ impl MagickWand {
|
|||||||
/// format (e.g. GIF, JPEG, PNG, etc).
|
/// format (e.g. GIF, JPEG, PNG, etc).
|
||||||
pub fn write_image_blob(&self, format: &str) -> Result<Vec<u8>, &'static str> {
|
pub fn write_image_blob(&self, format: &str) -> Result<Vec<u8>, &'static str> {
|
||||||
let c_format = CString::new(format).unwrap();
|
let c_format = CString::new(format).unwrap();
|
||||||
let mut length: size_t = 0;
|
let mut length: u64 = 0;
|
||||||
let blob = unsafe {
|
let blob = unsafe {
|
||||||
bindings::MagickSetImageFormat(self.wand, c_format.as_ptr());
|
bindings::MagickSetImageFormat(self.wand, c_format.as_ptr());
|
||||||
bindings::MagickResetIterator(self.wand);
|
bindings::MagickResetIterator(self.wand);
|
||||||
|
|||||||
Reference in New Issue
Block a user