{"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.4.0","deps":[],"features":{},"cksum":"sha256:41ed873bd6eb257eeef65c026835f25bd7eb44d7e56e50d2a31435221d401462","sig":"ed25519:3066526fc3fa6c27ba203b9a8eebb753e4ce4c619dfdf7a5a3955005da167c69ef647bcb254891dd445d266828fbd5ecb43ba04e203bbbd993d5fb569ab80b0a","key_fp":"SHA256:xl0hCTnhRoxLob4M6UdsT7Jtjn0a2wyYJf9ObIANTao","yanked":false,"edition":"2026","hew":">=0.6.2, <0.7.0","registry_sig":"ed25519:1fcab0a2e7143ace93a0fa9725480bb86ff44403e4123e26bd52802d26cc1736287725aac04b69151d96f1dac5af2058b92445b248e28f7c2daa40384978af0c","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-10-21T03:47:45.575Z","dl":"https://cdn.hewpkg.com/tarballs/hew/image/magick/0.4.0.tar.zst"}}