×

实用网站-图片转ICO工具网站来啦

hqy hqy 发表于2025-07-02 01:07:41 浏览13 评论0

抢沙发发表评论

基于SharpIco开发图片转ICO工具网站

SharpIcoWeb

?项目介绍

SharpIcoWeb是基于SharpIco开发的图片转ICO工具网站,支持上传png、jpg等图片转换为多尺寸的Ico图片文件。采用前后端分离技术。

后端接口使用 .NET Minimal API开发,够轻量。

?项目地址

https://github.com/ZyPLJ/SharpIcoWeb

? 应用场景

  • • 网站Favicon ?
  • • 软件图标 ?️
  • • 个性化文件夹标识 ?
<link rel="icon" type="image/x-icon" href="/logo.ico" />

✨核心技术

 Vite+Vue+Element-Plus 极速的开发服务器和高效的生产构建
?️ → ❌
 纯文件操作(无需SQLite/MySQL)
?️.NET 9 MiniAPI 轻量级API开发,处理图像转换业务逻辑?️
 后端使用的强大图像处理库,实现PNG/JPG转ICO
?
 可容器化(Docker 支持)
? + ?
 响应式设计(适配移动端)

✅后续更新

  • • 不同尺寸ICO,可分别生成ICO文件。
  • • 前端显示ICO文件图标数量数据、大小、偏移等数据。
  • • 批量转换功能。

?快速开始

Docker部署

注意注释部分配置可能需要根据实际情况修改

Docker CLI

docker-compose up --build -d

default.conf

server {
    listen       5173# 配置端口
    server_name0.0.0.0# 修改为docker服务宿主机的ip 

    # 设置允许的最大请求体大小(例如 100MB)
    client_max_body_size100M;

    location / {
        root   /usr/share/nginx/html;
        indexindex.htmlindex.htm;
        try_files $uri $uri/ /index.html =404;
    }

    location /api {
        proxy_passhttp://backend:5235;# Docker 内部网络
        proxy_set_headerHost $host;
        proxy_set_headerX-Real-IP $remote_addr;
    }

    error_page   500502503504  /50x.html;
    location = /50x.html {
        root   html;
    }
}

Docker Compose

version: '3.8'

services:
frontend:
    build:
      context:./sharp-ico-vue   # 指向前端目录
      dockerfile:Dockerfile
    ports:
      -"5173:5173"               # 前端映射到宿主机的5173端口
    depends_on:
      -backend

backend:
    build:
      context:.    # 指向后端目录
      dockerfile:Dockerfile
    ports:
      -"5235:5235"            # 后端端口

手动部署

clone

git clone https://github.com/ZyPLJ/SharpIcoWeb.git

后端运行

cd SharpIcoWeb

dotnet build -c Release

dotnet run

前端运行

cd ..

cd sharp-ico-vue

npm install

npm run dev

?如何使用

前后端项目运行或部署后,打开运行后网址。

选择需要生成的ICO图表尺寸,可多选


图片

image.png

上传图片文件,点击转换。


图片

image.png

? 开发指南

项目结构

sharp-ico/
├── SharpIco/               # 图标转换类库  
│   ├── SharpIco.csproj
├── SharpIcoWeb/            # 后端Api项目
│   ├── SharpIcoWeb.csproj
├── sharp-ico-vue           # 前端项目

开发环境

  • • .Net 9
  • • Node.js 20.19+
  • • Vue3

运行项目

后端

dotnet build -c Release

dotnet run

前端

npm install

npm run dev

相关链接

  • • SharpIco https://github.com/star-plan/sharp-ico ? Star if useful!
  • • SharpIcoWeb https://github.com/ZyPLJ/SharpIcoWeb ? Star if useful!


打赏

本文链接:https://www.kinber.cn/post/5204.html 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

 您阅读本篇文章共花了: 

群贤毕至

访客