3 Star 1 Fork 0

Gitee 极速下载 / imgsquash

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/eashish93/imgsquash
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

SUMMARY

Image compression full stack website code. Contains both api service and frontend written in node, react and next.js framework.

SCREENSHOTS

screen-one screen-two screen-three

SETTING UP GOOGLE CLOUD STORAGE

  1. Create a project on google cloud and add a free cloud storage bucket via this quickstart guide:
  2. Authenticate using either gcloud command line tool (download here) or set GOOGLE_APPLICATION_CREDENTIALS env variable with the service account file.

STARTING THE API SERVICE

  1. Create .env file in the root of the folder with the following variables. See dotenv on how to add env variables.
    • API_VERSION : 1 (optional).
    • GC_STORAGE : your-google-cloud-bucket-name
    • DL_BASE_URL : [YOUR-API-URL]/1/dl
  2. Do npm install to install all node modules for api.
  3. Do npm run dev to start the dev server on 3000 port.
  4. Do npm start for production

STARTING THE FRONTEND

  1. Do npm install to install all node modules for frontend.
  2. Do npm run dev will start the webpack server on 3001 port.
  3. Do npm run build and npm start to build and use the code in production.

NOTES

  1. Following programs are used for optimization

    • mozjpeg (lossy jpeg compression)
    • jpegtran (lossless jpeg compression)
    • pngquant (lossy png compression)
    • optipng (lossless png compression)
  2. Current file size upload limit is 10MB.

  3. API Routes. [POST]

    • /image: upload image(s) via file, URL, base64 or Binary.
      • file: file or base64 or binary.
      • lossy: Boolean (default: false)
    • /url: Compression direct image url.
      • url: valid image url.
    • /zip: Accepts list of files object as an array with (id, size and name) and send the zipped result.
      • files: list of files object as an array.

    [GET] - /dl/:id: Generate download url of compressed image. Accept optional query name.

LICENSE

MIT

Copyright 2019, Ashish Rawat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

imgsquash 是一个图像压缩全栈网站代码 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/mirrors/imgsquash.git
git@gitee.com:mirrors/imgsquash.git
mirrors
imgsquash
imgsquash
master

搜索帮助