import { rotate } from "https://deno.land/x/fresh_images@v0.3.0/transformer.ts";
Rotate an image by a given number of degrees.
Examples
Example 1
Example 1
import { defineConfig } from "$fresh/server.ts";
import ImagesPlugin from "fresh_images/mod.ts";
import { rotate } from "fresh_images/transformer.ts";
export default defineConfig({
plugins: [
ImagesPlugin({
publicPath: "/img",
transformers: { rotate },
}),
],
Example 2
Example 2
<img src="/img/meow.jpg?fn=rotate&d=270" alt="Rotated 270 degrees" />
<img src="/img/meow.jpg?fn=rotate&rotateDegrees=90" alt="Rotated 90 degrees" />
<img src="/img/meow.jpg?fn=rotate&rotateDegrees=-45" alt="Rotated -45 degrees" />
Parameters
req: Request
URL request containing transformation parameters