gogocome
V2EX  ›  问与答

有什么办法能自动监控文件夹,压缩新增的图片?

  •  
  •   gogocome · Jul 28, 2022 · 1963 views
    This topic created in 1413 days ago, the information mentioned may be changed or developed.

    我写了个 H5 的日记本放在腾讯云轻主机(linux)里自己用. 现在有个问题,上传的图片动辄 4Mb 起,浏览速度较慢. 能不能实现上传图片后在服务器里自动压缩(主要是调整大小). 后端是 php 的,有个压缩图片的方法,但是试了一下好像比较慢.

    7 replies    2022-07-28 14:51:09 +08:00
    liuguangxuan
        1
    liuguangxuan  
       Jul 28, 2022 via Android
    inotify
    wonderfulcxm
        2
    wonderfulcxm  
       Jul 28, 2022 via iPhone
    nodemon
    towave
        3
    towave  
       Jul 28, 2022 via Android
    github 上搜一大堆
    aec4d
        4
    aec4d  
       Jul 28, 2022
    incorn 十来年历史
    aec4d
        5
    aec4d  
       Jul 28, 2022
    打错了,incron
    miniers
        6
    miniers  
       Jul 28, 2022
    这活儿应该直接用 JS 上传前压缩下更合适吧🤣
    gogocome
        7
    gogocome  
    OP
       Jul 28, 2022
    已经用 incrond 和 imagemagick 搞定,特别好用!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1572 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 192ms · UTC 16:39 · PVG 00:39 · LAX 09:39 · JFK 12:39
    ♥ Do have faith in what you're doing.