{"metadata":{"name":"hew/image/magick","vers":"0.7.1","description":"Owned ImageMagick 7 images with typed transformation and I/O errors","license":"MIT OR Apache-2.0","authors":["Hew Contributors"],"deps":[],"features":{},"keywords":["image","imagemagick","processing"],"repository":"https://github.com/hew-lang/ecosystem","edition":"2026","hew":">=0.10.0, <0.12.0","readme":"# hew.image.magick\n\nOwned ImageMagick 7 images for Hew. Transformations and I/O report typed\nerrors, and native image handles are released on every scope exit.\n\n## System dependency\n\nThis package wraps ImageMagick 7 through `magick_rust`, so the MagickWand\nlibraries must be installed before anything here will link:\n\n```sh\nbrew install imagemagick pkg-config          # macOS\nsudo apt-get install libmagickwand-dev pkg-config   # Debian/Ubuntu\n```\n\n`pkg-config --modversion MagickWand` should report a 7.x version.\n\n## Linking\n\n`magick_rust`'s link directives do not survive the trip through this package's\nstaticlib, so `hew.toml` names the libraries itself with\n`pkg-config = [\"MagickWand\"]` in `[native]`. Every program that imports\n`hew.image.magick` links MagickWand without extra flags:\n\n```sh\nhew run --pkg-path . image/magick/examples/basic.hew\n```\n\n## Example\n\nSave this as `main.hew` in a project depending on\n`hew.image.magick = \"0.7.1\"`:\n\n```hew\nimport hew.image.magick;\n\nfn main() {\n    let image = spawn magick.Image { source: Source.Blank(640, 480, \"#3366cc\") };\n    let _ = image.thumbnail(160, 120);\n    let _ = image.sharpen(0.0, 0.5);\n    let png = match image.write_blob(\"PNG\") {\n        .Ok(value) => value,\n        .Err(_) => bytes.new(),\n    };\n    stop(image);\n    stopped(image);\n\n    // A freshly created image carries no ImageMagick format tag until it is\n    // decoded from real image data, so format() is checked on the reopened\n    // blob rather than on `image` itself.\n    let decoded = spawn magick.Image { source: Source.Blob(png) };\n    match decoded.format() {\n        .Ok(value) => println(value),\n        .Err(.Failed(error)) => println(magick.error_message(error)),\n        .Err(_) => println(\"image actor stopped before replying\"),\n    }\n    stop(decoded);\n    stopped(decoded);\n}\n```\n\nThe checked example lives at [`examples/basic.hew`](examples/basic.hew); it\nwrites `magick-example.png` beside you and prints `magick-example.png is PNG`.\n\nEvery `Image` method declares `fails MagickError`, so a call replies\n`Result<T, ActorError<MagickError>>`: `.Ok(value)` on success,\n`.Err(.Failed(error))` for an image error, and another `.Err` variant when the\nactor could not answer (for example `.Dead` after it stopped). The transforms\n(`resize`, `crop`, `rotate`, `blur`, `sharpen`, `flip`, `flop`, `thumbnail`)\nand `write` reply `()` on success; `width`, `height`, `format` and\n`write_blob` reply the value.\n\n`write_blob` explicitly selects the encoded format. File output remains\navailable through `write`, where ImageMagick infers the format from the path.\n"},"version":{"name":"hew/image/magick","vers":"0.2.0","deps":[],"features":{},"cksum":"sha256:7f432acc8dcf20c6d61cca0dc93c378868eb521a67dd743b1754bae9a7d1f8de","sig":"ed25519:d93395f5ad59cddaac91d0d5bd4fb9a96e75159d43a4aee68ffb10fa9f1ef68386a990d8172c214c81ace47dc94308e5d855f9a63ea05f6f366ac46814263305","key_fp":"SHA256:hjy+Qd+OmgMY/hUNOh/keaZY5UM/mSWxalxWWTePbtQ","yanked":false,"edition":"2026","hew":">=0.6.0-rc1, <0.7.0","registry_sig":"ed25519:08d9d06e60f3cea6468ebea248f72c5b65a85380dc339ce9f41a9b71bc5c65c03341d468f5da866d9d4238237b44c5bc20907df103a32da12d0809f3d7bbde00","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-08-15T20:57:10.439Z","dl":"https://cdn.hewpkg.com/tarballs/hew/image/magick/0.2.0.tar.zst"}}