refactor(重构提升): 修复裁剪并优化转换渲染
build.yaml / build (push) Successful in 47s

This commit is contained in:
xiaoqidun committed 2026-10-06 23:09:49 +08:00
1 parent 619899e297
commit e8344e6387
27 files changed
+754 -150

No files matched your search

+6 -3
View File
@@ -146,6 +146,7 @@ func (p *pdfImporter) image(mark pdfgo.ImageMark) error {
break
}
}
streamCached := id != ""
var contentKey pdfImageContentKey
cacheable := false
if id == "" {
@@ -207,13 +208,15 @@ func (p *pdfImporter) image(mark pdfgo.ImageMark) error {
if err != nil {
return err
}
if cacheable {
p.imageContents.put(contentKey, pdfImageContent{source: source, id: id}, len(source.Stream.Data)+65536)
}
}
if !streamCached {
if p.imageIDs == nil {
p.imageIDs = map[pdfImageKey][]pdfImageResource{}
}
p.imageIDs[key] = append(p.imageIDs[key], pdfImageResource{space: source.ColorSpace, id: id})
if cacheable {
p.imageContents.put(contentKey, pdfImageContent{source: source, id: id}, len(source.Stream.Data)+65536)
}
}
return p.appendImage(mark, id)
}