{"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.1.0","deps":[],"features":{},"cksum":"sha256:3c5665e9c876a4b367de5626427a5615a58761da821622337cbaf3287d96c0e2","sig":"ed25519:eace6e2f40d96499d2e34feac402ee725fefefec0cf8ddade047dd69ca26b31f2b8c0301ff197dab840889ab9f2963d36975c8111c128b02da2ad1af7979b20e","key_fp":"SHA256:3njv78NJD/NTkV83eJ86yfrXqpu+l652GAjPzB/Grp0","yanked":false,"registry_sig":"ed25519:1f7a3fd43c5e53cd58d75db2de9d8f6d36f3b5c864a6d2bd9711d4fc1b8766367785fa2040a1901525bdaeb15ebf803b6f4726deea554dd1c14b102fef8ad705","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-03-12T21:11:04.954Z","dl":"https://cdn.hewpkg.com/tarballs/hew/image/magick/0.1.0.tar.zst"}}