Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Jun 12, 2024
1 parent 8d75314 commit 00b9902
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 21 deletions.
1 change: 1 addition & 0 deletions packages/config-eslint/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
".*.js",
"node_modules/",
"dist/",
"**/browser.js",
],
overrides: [
{
Expand Down
Binary file added packages/docs/src/assets/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 51 additions & 19 deletions packages/docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -1,36 +1,68 @@
---
title: Welcome to Starlight
description: Get started building your docs site with Starlight.
title: Jimp
description: JavaScript Image Manipulation Program
template: splash
hero:
tagline: Congrats on setting up a new Starlight project!
tagline: The JavaScript Image Manipulation Program
image:
file: ../../assets/houston.webp
file: ../../assets/image.png
actions:
- text: Getting Started
- text: Read the docs
link: /guides/getting-started/
icon: right-arrow
variant: primary
- text: Read the Starlight docs
link: https://starlight.astro.build
- text: GitHub
link: https://github.com/jimp-dev/jimp
icon: external
---

import { Card, CardGrid } from '@astrojs/starlight/components';
import { Steps, Card, CardGrid, LinkCard } from '@astrojs/starlight/components';

## Next steps

<CardGrid stagger>
<Card title="Update content" icon="pencil">
Edit `src/content/docs/index.mdx` to see this page change.
<CardGrid >
<Card title="Image Formats" icon="pencil">
Supported image formats include PNG, JPEG, BMP, GIF, and TIFF.
</Card>
<Card title="Add new content" icon="add-document">
Add Markdown or MDX files to `src/content/docs` to create new pages.
<Card title="Image Manipulation" icon="add-document">
You can resize, crop, apply filters and more.
</Card>
<Card title="Configure your site" icon="setting">
Edit your `sidebar` and other config in `astro.config.mjs`.
<Card title="Pluggable" icon="setting">
Create your own plugins to add new image manipulation methods or formats.
</Card>
<Card title="Read the docs" icon="open-book">
Learn more in [the Starlight Docs](https://starlight.astro.build/).
<Card title="Just JavaScript" icon="open-book">
Jimp is just JavaScript, so you can use it in anywhere that JavaScript can be used.
</Card>
</CardGrid>

## Usage

Using Jimp is simple.
Load an image, manipulate it, and save it.

<Steps>

1. Load an image.

```ts
import Jimp from "jimp";

const image = await Jimp.read("test/image.png");
```

2. Manipulate the image.

```ts
image.resize({ width: 100 });
```

3. Save the image.

```ts
await image.write("test/output.png");
```

</Steps>

<CardGrid>
<LinkCard title="Getting Started" href="/guides/getting-started/" />
<LinkCard title="API Reference" href="/api/jimp/classes/jimp/" />
</CardGrid>
2 changes: 0 additions & 2 deletions packages/jimp/src/jimp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ describe("hasAlpha", () => {
test("image with no alpha", async () => {
const image = await Jimp.read(getTestImagePath("cops.jpg"));
expect(image.hasAlpha()).toBe(false);

await image.write("test/output.png");
});

test("image with alpha", async () => {
Expand Down

0 comments on commit 00b9902

Please sign in to comment.