{"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.1","deps":[],"features":{},"cksum":"sha256:23243841391b0d3ad5d339c34fee4df5a1aa1133d59098e3de8816c27ce44518","sig":"ed25519:636630fa45e19095065cec25b0cafee8dfaff8370b68ceac5c2478f3cbdd5dab683cc195652d9ccbd07f7bb7df7dba6b35c00a553c6262bc356a87055df76d09","key_fp":"SHA256:gk8UzG1JaUDuLgtKkCWyxdIF7vtNvUrDqykgv3ZwQTo","yanked":false,"edition":"2026","hew":">=0.6.2, <0.8.0","registry_sig":"ed25519:8e5ed6ca475d08c016fcd41aecf75991728b4d1c75ac265c6620965f8e976aad2ef5b9eb865f80c0e133a03533b8b5bd468bd12cab0b1a6152f1314666dc2c01","registry_key_fp":"SHA256:NR2yrof9/ZWkCWyhDODRU8Yvm9Lob/0yYVTdCKzMHb8","published_at":"2026-10-22T10:01:25.669Z","dl":"https://cdn.hewpkg.com/tarballs/hew/image/magick/0.4.1.tar.zst"}}