{"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.7.0","deps":[],"features":{},"cksum":"sha256:f8c0fe9e9de1f888e309a025648e6c3bc593ace01ba331942c78ca68d6ced99e","sig":"ed25519:cd7e406302eb2f87e1c405e6cac4c2f031e250f21898c1e7344a00430fa4a059bc4e3fe205b605e4bf3babb10b4d4e153959e1547daa27416cbea2001a6e3805","key_fp":"SHA256:QDgYk38yt+UbTDqWpi+aVd+Vkirhyd7m4y+5bVuNIpg","yanked":false,"edition":"2026","hew":">=0.10.0, <0.12.0","registry_sig":"ed25519:574e269555c05ecb997a49438aeede0814b47c7acc2bfd1e762ce8c3bc38440ff33e5cb883775d777e58aa8e2fdf2f31bcd38cb3f3b8bfbf811c706a0c42af00","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-11-13T06:01:17.939Z","dl":"https://cdn.hewpkg.com/tarballs/hew/image/magick/0.7.0.tar.zst"}}