mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 17:27:08 +08:00
This commit is contained in:
1 parent
619899e297
commit
e8344e6387
27 files changed
+754
-150
No files matched your search
+6
-3
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user