支持svg、png和jpeg在线预览

dev
truthhun 6 months ago
parent e4ee461f04
commit c282569755

@ -68,6 +68,7 @@ type Document struct {
User *User `protobuf:"bytes,31,opt,name=user,proto3" json:"user,omitempty"`
EnableGzip bool `protobuf:"varint,32,opt,name=enable_gzip,json=enableGzip,proto3" json:"enable_gzip,omitempty"`
ConvertError string `protobuf:"bytes,33,opt,name=convert_error,json=convertError,proto3" json:"convert_error,omitempty"`
PreviewExt string `protobuf:"bytes,34,opt,name=preview_ext,json=previewExt,proto3" json:"preview_ext,omitempty"`
}
func (m *Document) Reset() { *m = Document{} }
@ -334,6 +335,13 @@ func (m *Document) GetConvertError() string {
return ""
}
func (m *Document) GetPreviewExt() string {
if m != nil {
return m.PreviewExt
}
return ""
}
// 删除文档,放入回收站
type DeleteDocumentRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
@ -1381,116 +1389,117 @@ func init() {
func init() { proto.RegisterFile("api/v1/document.proto", fileDescriptor_55a584ae3a7fc022) }
var fileDescriptor_55a584ae3a7fc022 = []byte{
// 1736 bytes of a gzipped FileDescriptorProto
// 1750 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0xdd, 0x6e, 0xdb, 0xc8,
0x15, 0x0e, 0x45, 0xd9, 0x96, 0x8e, 0x64, 0x45, 0x99, 0x58, 0x36, 0x4d, 0xdb, 0x92, 0xc2, 0xd4,
0xad, 0xd7, 0x28, 0x2c, 0xc4, 0x45, 0x7b, 0xb1, 0x7b, 0x51, 0x78, 0x9d, 0x34, 0x6b, 0xa0, 0x28,
0x16, 0xcc, 0x06, 0x0b, 0xec, 0x8d, 0xca, 0x88, 0x63, 0x89, 0x2d, 0x25, 0xb2, 0xe4, 0xc8, 0xaa,
0x82, 0xf6, 0xa6, 0x0f, 0x50, 0x2c, 0xd0, 0x57, 0xe9, 0x43, 0xf4, 0xaa, 0x08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b, 0xda, 0x37, 0x1f, 0xba, 0x0f, 0xde, 0x7d, 0xe8, 0x3e, 0xf8, 0xc7, 0x87, 0xee,
0x03, 0x90, 0xff, 0x27, 0x3f, 0xd7, 0xbe, 0x7a, 0x34, 0x0d, 0x22, 0xea, 0x06, 0x23, 0x09, 0xf4,
0xc9, 0xcd, 0xb3, 0x37, 0x9b, 0x48, 0xf6, 0xa3, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x7a, 0xf8,
0xb0, 0xc9, 0xdc, 0x14, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -2277,6 +2286,15 @@ func (m *Document) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if len(m.PreviewExt) > 0 {
i -= len(m.PreviewExt)
copy(dAtA[i:], m.PreviewExt)
i = encodeVarintDocument(dAtA, i, uint64(len(m.PreviewExt)))
i--
dAtA[i] = 0x2
i--
dAtA[i] = 0x92
}
if len(m.ConvertError) > 0 {
i -= len(m.ConvertError)
copy(dAtA[i:], m.ConvertError)
@ -3578,6 +3596,10 @@ func (m *Document) Size() (n int) {
if l > 0 {
n += 2 + l + sovDocument(uint64(l))
}
l = len(m.PreviewExt)
if l > 0 {
n += 2 + l + sovDocument(uint64(l))
}
return n
}
@ -4907,6 +4929,38 @@ func (m *Document) Unmarshal(dAtA []byte) error {
}
m.ConvertError = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 34:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field PreviewExt", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowDocument
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthDocument
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthDocument
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.PreviewExt = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipDocument(dAtA[iNdEx:])

@ -53,6 +53,7 @@ message Document {
User user = 31; //
bool enable_gzip = 32; // gzip
string convert_error = 33; //
string preview_ext = 34; //
}
//

@ -247,11 +247,16 @@ func (s *AttachmentAPIService) ViewDocumentPages(ctx *gin.Context) {
return
}
page := strings.TrimLeft(ctx.Param("page"), "./")
if strings.HasSuffix(page, ".gzip.svg") {
ctx.Header("Content-Encoding", "gzip")
if strings.HasSuffix(page, ".svg") {
if strings.HasSuffix(page, ".gzip.svg") {
ctx.Header("Content-Encoding", "gzip")
}
ctx.Header("Content-Type", "image/svg+xml")
}
ctx.Header("Content-Type", "image/svg+xml")
ctx.File(fmt.Sprintf("documents/%s/%s/%s", strings.Join(strings.Split(hash, "")[:5], "/"), hash, page))
file := fmt.Sprintf("documents/%s/%s/%s", strings.Join(strings.Split(hash, "")[:5], "/"), hash, page)
s.logger.Debug("ViewDocumentPages", zap.String("hash", hash), zap.String("page", page), zap.String("file", file))
ctx.File(file)
}
func (s *AttachmentAPIService) ViewDocumentCover(ctx *gin.Context) {

@ -267,6 +267,7 @@ const (
ConfigConverterEnableSVGO = "enable_svgo" // 是否启用 SVGO
ConfigConverterEnableGZIP = "enable_gzip" // 是否启用 GZIP
ConfigConverterEnableConvertRepeatedDocument = "enable_convert_repeated_document" // 是否转换已转换的重复文档
ConfigConverterExtension = "extension" // 转换后的文件扩展名,即以什么方式来浏览文档,支持 jpg、png、svg默认为svgpdf和html暂不支持
)
const (
@ -301,6 +302,7 @@ type ConfigConverter struct {
EnableGZIP bool `json:"enable_gzip"` // 是否对svg启用GZIP压缩。转换效率会有所下降。相对直接的svg文件可以节省3/4的存储空间
EnableConvertRepeatedDocument bool `json:"enable_convert_repeated_document"` // 是否转换已转换的重复文档。如果开启,会导致转换效率下降,但是可以节省大量的存储空间
// GZIP和svgo都开启转换效率会有所下降可以综合节省约85%的存储空间
Extension string `json:"extension"` // 转换后的文件扩展名,即以什么方式来浏览文档,支持 jpg、png、svg默认为svgpdf和html暂不支持
}
const (
@ -696,11 +698,12 @@ func (m *DBModel) initConfig() (err error) {
{Category: ConfigCategoryFooter, Name: ConfigFooterFeedback, Label: "意见反馈", Value: "/article/feedback", Placeholder: "请输入意见反馈的链接地址,留空表示不显示", InputType: InputTypeText, Sort: 28, Options: ""},
// 转换配置项
{Category: ConfigCategoryConverter, Name: ConfigConverterMaxPreview, Label: "最大预览页数", Value: "12", Placeholder: "文档允许的最大预览页数0表示不限制", InputType: InputTypeNumber, Sort: 15, Options: ""},
{Category: ConfigCategoryConverter, Name: ConfigConverterTimeout, Label: "转换超时(分钟)", Value: "30", Placeholder: "文档转换超时时间默认为30分钟", InputType: InputTypeNumber, Sort: 16, Options: ""},
{Category: ConfigCategoryConverter, Name: ConfigConverterEnableGZIP, Label: "是否启用GZIP压缩", Value: "true", Placeholder: "是否对文档SVG预览文件启用GZIP压缩启用后转换效率会【稍微】下降但相对直接的SVG文件减少75%的存储空间", InputType: InputTypeSwitch, Sort: 17, Options: ""},
{Category: ConfigCategoryConverter, Name: ConfigConverterEnableSVGO, Label: "是否启用SVGO", Value: "false", Placeholder: "是否对文档SVG预览文件启用SVGO压缩启用后转换效率会【明显】下降但相对直接的SVG文件减少50%左右的存储空间", InputType: InputTypeSwitch, Sort: 18, Options: ""},
{Category: ConfigCategoryConverter, Name: ConfigConverterEnableConvertRepeatedDocument, Label: "是否转换重复文档", Value: "false", Placeholder: "对于已转换过的文档,再次被上传时是否再转换一次", InputType: InputTypeSwitch, Sort: 20, Options: ""},
{Category: ConfigCategoryConverter, Name: ConfigConverterMaxPreview, Label: "最大预览页数", Value: "12", Placeholder: "文档允许的最大预览页数0表示不限制", InputType: InputTypeNumber, Sort: 0, Options: ""},
{Category: ConfigCategoryConverter, Name: ConfigConverterTimeout, Label: "转换超时(分钟)", Value: "30", Placeholder: "文档转换超时时间默认为30分钟", InputType: InputTypeNumber, Sort: 10, Options: ""},
{Category: ConfigCategoryConverter, Name: ConfigConverterExtension, Label: "预览格式", Value: "svg", Placeholder: "将文档转为特定格式以供预览", InputType: InputTypeSelect, Sort: 20, Options: "svg:SVG\njpg:JPEG\npng:PNG"},
{Category: ConfigCategoryConverter, Name: ConfigConverterEnableGZIP, Label: "是否启用GZIP压缩", Value: "true", Placeholder: "是否对文档SVG预览文件启用GZIP压缩启用后转换效率会【稍微】下降但相对直接的SVG文件减少75%的存储空间", InputType: InputTypeSwitch, Sort: 30, Options: ""},
{Category: ConfigCategoryConverter, Name: ConfigConverterEnableSVGO, Label: "是否启用SVGO", Value: "false", Placeholder: "是否对文档SVG预览文件启用SVGO压缩启用后转换效率会【明显】下降但相对直接的SVG文件减少50%左右的存储空间", InputType: InputTypeSwitch, Sort: 40, Options: ""},
{Category: ConfigCategoryConverter, Name: ConfigConverterEnableConvertRepeatedDocument, Label: "是否转换重复文档", Value: "false", Placeholder: "对于已转换过的文档,再次被上传时是否再转换一次", InputType: InputTypeSwitch, Sort: 50, Options: ""},
// 下载配置
{Category: ConfigCategoryDownload, Name: ConfigDownloadEnableGuestDownload, Label: "是否允许游客下载", Value: "false", Placeholder: "启用之后,未登录用户可以下载免费文档", InputType: InputTypeSwitch, Sort: 10, Options: ""},

@ -63,6 +63,7 @@ type Document struct {
DeletedUserId int64 `form:"deleted_user_id" json:"deleted_user_id,omitempty" gorm:"column:deleted_user_id;type:bigint(20);size:20;default:0;comment:删除用户ID;"`
EnableGZIP bool `form:"enable_gzip" json:"enable_gzip,omitempty" gorm:"column:enable_gzip;type:tinyint(1);size:1;default:0;comment:是否启用GZIP压缩;"`
RecommendAt *time.Time `form:"recommend_at" json:"recommend_at,omitempty" gorm:"column:recommend_at;type:datetime;comment:推荐时间;index:idx_recommend_at;"`
PreviewExt string `form:"preview_ext" json:"preview_ext,omitempty" gorm:"column:preview_ext;type:varchar(16);size:16;default:.svg;comment:预览图扩展名;"`
}
func (Document) TableName() string {
@ -701,18 +702,23 @@ func (m *DBModel) ConvertDocument() (err error) {
toPage = document.Pages
}
pages, err = cvt.ConvertPDFToSVG(dstPDF, 1, toPage, cfg.EnableSVGO, cfg.EnableGZIP)
pages, err = cvt.ConvertPDFToPages(dstPDF, 1, toPage, &converter.OptionConvertPages{
EnableSVGO: cfg.EnableSVGO,
EnableGZIP: cfg.EnableGZIP,
Extension: cfg.Extension,
})
if err != nil {
m.SetDocumentStatus(document.Id, DocumentStatusFailed)
m.logger.Error("ConvertDocument", zap.Error(err))
return
}
ext := "." + cfg.Extension
if ext == ".svg" && cfg.EnableGZIP {
ext = ".gzip.svg"
}
for _, page := range pages {
ext := ".svg"
if strings.HasSuffix(page.PagePath, ".gzip.svg") {
ext = ".gzip.svg"
}
dst := fmt.Sprintf(baseDir+"/%d%s", page.PageNum, ext)
m.logger.Debug("ConvertDocument CopyFile", zap.String("src", page.PagePath), zap.String("dst", dst))
errCopy := util.CopyFile(page.PagePath, dst)
@ -734,7 +740,8 @@ func (m *DBModel) ConvertDocument() (err error) {
document.Status = DocumentStatusConverted
document.EnableGZIP = cfg.EnableGZIP
err = m.db.Select("description", "cover", "width", "height", "preview", "pages", "status", "enable_gzip").Where("id = ?", document.Id).Updates(document).Error
document.PreviewExt = ext
err = m.db.Select("description", "cover", "width", "height", "preview", "pages", "status", "enable_gzip", "preview_ext").Where("id = ?", document.Id).Updates(document).Error
if err != nil {
m.SetDocumentStatus(document.Id, DocumentStatusFailed)
m.logger.Error("ConvertDocument", zap.Error(err))

@ -26,6 +26,7 @@ const (
mutool = "mutool"
inkscape = "inkscape"
dirDteFmt = "2006/01/02"
imageMagick = "convert"
)
type ConvertCallback func(page int, pagePath string, err error)
@ -167,6 +168,54 @@ func (c *Converter) ConvertPDFToSVG(src string, fromPage, toPage int, enableSVGO
return
}
type OptionConvertPages struct {
EnableSVGO bool
EnableGZIP bool
Extension string
}
// ConvertPDFToPages 将PDF转为预览页
func (c *Converter) ConvertPDFToPages(src string, fromPage, toPage int, option *OptionConvertPages) (pages []Page, err error) {
switch strings.TrimLeft(option.Extension, ".") {
case "png":
return c.ConvertPDFToPNG(src, fromPage, toPage)
case "jpg":
// 见将pdf转为png然后png再转为jpg
pages, err = c.ConvertPDFToPNG(src, fromPage, toPage)
// 通过imagemagick将图片转为jpg
for idx, page := range pages {
if dst, errConvert := c.ConvertPNGToJPG(page.PagePath); errConvert == nil {
os.Remove(page.PagePath)
page.PagePath = dst
pages[idx] = page
}
}
return pages, err
default: // 默认转为svg
return c.ConvertPDFToSVG(src, fromPage, toPage, option.EnableSVGO, option.EnableGZIP)
}
}
// 将png转为jpg
func (c *Converter) ConvertPNGToJPG(src string) (dst string, err error) {
dst = strings.TrimSuffix(src, filepath.Ext(src)) + ".jpg"
// 通过imagemagick将图片转为jpg
args := []string{
src,
dst,
}
c.logger.Debug("convert png to jpg", zap.String("cmd", imageMagick), zap.Strings("args", args))
_, err = command.ExecCommand(imageMagick, args, c.timeout)
if err != nil {
c.logger.Error("convert png to jpg", zap.String("cmd", imageMagick), zap.Strings("args", args), zap.Error(err))
}
return
}
func (c *Converter) ConvertPDFToJPG(src string, fromPage, toPage int) (pages []Page, err error) {
return c.convertPDFToPage(src, fromPage, toPage, ".jpg")
}
// ConvertPDFToPNG 将PDF转为PNG
func (c *Converter) ConvertPDFToPNG(src string, fromPage, toPage int) (pages []Page, err error) {
return c.convertPDFToPage(src, fromPage, toPage, ".png")

@ -416,7 +416,7 @@ import {
getDocumentScore,
} from '~/api/document'
import { getFavorite, createFavorite, deleteFavorite } from '~/api/favorite'
import { formatDatetime, formatBytes, getIcon } from '~/utils/utils'
import { formatDatetime, formatBytes, getIcon, genPrevPage } from '~/utils/utils'
import { documentStatusOptions } from '~/utils/enum'
import QRCode from 'qrcodejs2' // 引入qrcode
import FormComment from '~/components/FormComment.vue'
@ -555,9 +555,7 @@ export default {
// 限定预览页数,拼装图片链接
const pages = []
for (let i = 1; i <= preview; i++) {
const src = doc.enable_gzip
? `/view/page/${doc.attachment.hash}/${i}.gzip.svg`
: `/view/page/${doc.attachment.hash}/${i}.svg`
const src= genPrevPage(doc.attachment.hash, i, doc.preview_ext, doc.enable_gzip)
pages.push({
lazySrc: src,
src: src,
@ -879,9 +877,7 @@ export default {
if (document.fullscreenElement) startLazyLoad = 5
for (let i = this.pages.length + 1; i <= end; i++) {
j += 1
const src = this.document.enable_gzip
? `/view/page/${this.document.attachment.hash}/${i}.gzip.svg`
: `/view/page/${this.document.attachment.hash}/${i}.svg`
const src= genPrevPage(this.document.attachment.hash, i, this.document.preview_ext, this.document.enable_gzip)
this.pages.push({
// 前两页,直接不要懒加载,如果非全屏
src: j <= startLazyLoad ? src : this.loadingImage,

@ -279,3 +279,13 @@ export function genTimeDuration(duration) {
}
return [start.Format(fmt), new Date().Format(fmt)]
}
export function genPrevPage(hash, pageNO, ext, enableGZIP){
if (!ext){
ext=".svg"
}
if (ext===".svg" && enableGZIP){
ext=".gzip.svg"
}
return `/view/page/${hash}/${pageNO}${ext}`
}
Loading…
Cancel
Save