Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
bookyo
image-server-node
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
image-server-node
/
README
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
34 lines (25 loc) · 1.39 KB
main
Breadcrumbs
image-server-node
/
README
Copy path
Top
File metadata and controls
Code
Blame
34 lines (25 loc) · 1.39 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
expressjs+agenda+mongo+sharpjs制作的图片服务器,可在线处理图片并且缓存至服务器,支持height,width,format参数,支持判断浏览器是否支持WEBP,然后返回webp或者jpg。
设置config/config.js:
```
module.exports = {
dbUrl: "127.0.0.1",
db: "imageserver",
dbUser: "imageserver",
dbPassword: "imageserver",
keeptime: 3, //单位分钟 Minutes
whiteLists: [
'image.querydata.org'
]
};
```
keeptime为文件保留分钟,每次请求会刷新文件的lastseen时间,只有那些lastseen时间超过设置的keeptime的会进行删除!
whiteLists设置仅处理哪些域名的图片,不带协议!若留空数组即[],则可对任意网站的图片生效!
支持jpg和png的在线处理。
测试链接:
https://imageserver.querydata.org/api?url=https://wmdb.querydata.org/movie/poster/no-poster.jpg&width=200&format=webp
已经做了白名单,仅用于image.querydata.org中的图片处理。
用于wmdb项目:
https://github.com/iiiiiii1/douban-imdb-api
运行之后,访问/api?url=imageurl&width=200&height=300&format=webp,即可看见处理之后图片。
format支持webp,jpg和png三个参数,推荐使用format=webp,会根据浏览器是否支持webp来返回webp格式图片或者jpg格式图片。
width和height,至少存在其中一个,当单独只有其中一个参数时,则另外一个参数会自适应处理!
You can’t perform that action at this time.