Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
forked fromunjs/ipx

High performance, secure and easy to use image proxy based on Sharp and libvips.

License

NotificationsYou must be signed in to change notification settings

carlo697/ipx

 
 

Repository files navigation

NPM VernionNPM DownloadsPackage Size

High performance, secure and easy to use image proxy based onsharp andlibvips.

Usage

Quick Start

You can useipx command to start server using:

$ npx ipx

The default server directory is the current working directory.

Programatic Usage

You can use IPX as a Connect/Express middleware or directly use ipx api.

import{createIPX,createIPXMiddleware}from"ipx";constipx=createIPX(/* options */);constapp=express();app.use("/image",createIPXMiddleware(ipx));

Examples

The examples assume that astatic folder withbuffalo.png file is present in the directory where IPX server is running.

Get original image:

http://localhost:3000/_/static/buffalo.png

Change format towebp and keep other things same as source:

http://localhost:3000/f_webp/static/buffalo.png

Keep original format (png) and set width to200:

http://localhost:3000/w_200/static/buffalo.png

Resize to200x200px usingembed method and change format towebp:

http://localhost:3000/embed,f_webp,s_200x200/static/buffalo.png

Modifiers

PropertyDocsExampleComments
width / wDocshttp://localhost:3000/width_200/buffalo.png
height / hDocshttp://localhost:3000/height_200/buffalo.png
resize / sDocshttp://localhost:3000/s_200x200/buffalo.png
fitDocshttp://localhost:3000/s_200x200,fit_outside/buffalo.pngSetsfit option forresize.
position / posDocshttp://localhost:3000/s_200x200,pos_top/buffalo.pngSetsposition option forresize.
trimDocshttp://localhost:3000/trim_100/buffalo.png
formatDocshttp://localhost:3000/format_webp/buffalo.pngSupported format:jpg,jpeg,png,webp,avif,gif,heif
quality / q_http://localhost:3000/quality_50/buffalo.pngAccepted values: 0 to 100
rotateDocshttp://localhost:3000/rotate_45/buffalo.png
enlarge_http://localhost:3000/enlarge,s_2000x2000/buffalo.pngAllow the image to be upscaled. By default the returned image will never be larger than the source in any dimension, while preserving the requested aspect ratio.
flipDocshttp://localhost:3000/flip/buffalo.png
flopDocshttp://localhost:3000/flop/buffalo.png
sharpenDocshttp://localhost:3000/sharpen_30/buffalo.png
medianDocshttp://localhost:3000/median_10/buffalo.png
blurDocshttp://localhost:3000/blur_5/buffalo.png
gammaDocshttp://localhost:3000/gamma_3/buffalo.png
negateDocshttp://localhost:3000/negate/buffalo.png
normalizeDocshttp://localhost:3000/normalize/buffalo.png
thresholdDocshttp://localhost:3000/threshold_10/buffalo.png
tintDocshttp://localhost:3000/tint_1098123/buffalo.png
grayscaleDocshttp://localhost:3000/grayscale/buffalo.png
animated-http://localhost:3000/animated/buffalo.gifExperimental

Config

Config can be customized usingIPX_* environment variables.

  • IPX_DIR

    • Default:. (current working directory)
  • IPX_DOMAINS

    • Default:[]

License

MIT

About

High performance, secure and easy to use image proxy based on Sharp and libvips.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript99.8%
  • JavaScript0.2%

[8]ページ先頭

©2009-2025 Movatter.jp