import { crop } from "https://deno.land/x/fresh_images@v0.3.0/transformer.ts";
Crop an image to a specified area.
Examples
Example 1
Example 1
import { defineConfig } from "$fresh/server.ts";
import ImagesPlugin from "fresh_images/mod.ts";
import { crop } from "fresh_images/transformer.ts";
export default defineConfig({
plugins: [
ImagesPlugin({
publicPath: "/img",
transformers: { crop },
}),
],
});
Example 2
Example 2
<img src="/img/meow.jpg?fn=crop&cx=100&cy=100&cw=100&ch=100" alt="Cropped to 100px by 100px starting at 100px by 100px" />
Parameters
req: Request
URL request containing transformation parameters