火山引擎 veImageX 集成

火山引擎 veImageX 集成

原创

介绍

复制粘贴:https://www.volcengine.com/products/imagex

安装

composer require ExerciseBook/fof-upload-imagex

配置

在后台中将 fof-uploadfof-upload-imagex 插件启用。然后按照需要对这两个插件进行配置。

  1. 修改 fof-upload-imagex 的配置使得本插件能够正常使用火山引擎图像托管平台。
  2. 修改 fof-upload 的配置,将图片的上传方式和显示模板改为 ImageX

其他

链接

英文社区:https://discuss.flarum.org/d/31491

1 个月 后

CharlieK 没用过你这个,我只用过七牛和这个veImageX

区别可能就是,如果imgur完全免费的话。
那么火山引擎是有流量限制的。不过在速度和图片引擎上绝对优势。
我测试下来。600kb的图片压缩到13kb预览。点击查看原图秒开,眼睛都不眨一下。
1.5M的图片预览在50kb左右。

2 年 后

使用了ImageX模板之后,图片无法点击了,这个是怎么回事呀?

我修改了下代码,图片好像支持fancybox了,先用用试试

// resources/templates/imagex-preview.blade.php
// <img src="{@preview_uri}" data-src="{@fullscreen_uri}" title="{@base_name}" alt="{@base_name}"/>

<a href="{@fullscreen_uri}" data-fancybox="gallery">
  <img src="{@preview_uri}" alt="{@base_name}"/>
</a>

看了下Fancybox代码,应该是需要图片被包裹在<a>标签中才能工作

视频尺寸改成自适应,目前测试还正常
resources/templates/imagex-video-preview.blade.php

<video width="100%" height="auto" controls class="fof-upload-imagex fof-upload-imagex-video-preview">
    <source src="{@preview_uri}">
    Your browser does not support the video tag.
</video>

效果不错,上下线条是我视频的问题
Image description

    Eric_Lian 目前用上了,太棒了这个扩展,文件的模板要是加个能自定义文件名就好了。

      BA7IEE
      最新的 dev master 没啥问题吧。没啥问题的话 我先修一下。因为适配最新的 fancybox 这玩意儿比较要紧。

        Eric_Lian 都没问题,我最近几天才搭建的,所有的插件都是最新的,主程序也是最新的 1.8.8,是可以抽时间做个大更新了哈哈哈! 这是我的https://gc.23cc.cn

        2 个月 后

        安装了,然后提示
        Fatal error: Declaration of ExerciseBook\FofUploadImageX\Templates\ImageXPreviewTemplate::template(): string must be compatible with FoF\Upload\Contracts\TextFormatterTemplate::template(): Illuminate\Contracts\View\View in /home/bbsfrpcx/domains/black.1919810.com/public_html/vendor/exercisebook/fof-upload-imagex/src/Templates/ImageXPreviewTemplate.php on line 36