Giter Site home page Giter Site logo

缩略图背景颜色支持配置么?原图背景颜色为透明,生成的缩略图的背景颜色是黑色 about x-file-storage HOT 1 CLOSED

dromara avatar dromara commented on May 13, 2024
缩略图背景颜色支持配置么?原图背景颜色为透明,生成的缩略图的背景颜色是黑色

from x-file-storage.

Comments (1)

1171736840 avatar 1171736840 commented on May 13, 2024

这是因为缩略图默认保存为jpg,可以尝试改为png,但是png的体积没有jpg小。

因为图片处理使用的是 https://github.com/coobird/thumbnailator 你也可以自己操作缩略图

fileStorageService.of(file)
        .image(img -> img.size(1000,1000))  //将图片大小调整到 1000*1000
        .thumbnail(th -> th.size(200,200))  //再生成一张 200*200 的缩略图(这里操作缩略图)
        .upload();

from x-file-storage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.