mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
This commit is contained in:
1 parent
bcb9f98f8b
commit
3959664448
52 files changed
+1864
-407
No files matched your search
+11
-2
@@ -432,7 +432,7 @@ func (e *Editor) writePartsWithPages(write func(string, []byte, bool) error, pro
|
||||
}
|
||||
}
|
||||
for _, resource := range e.resources {
|
||||
if resource.definition() != "" && slices.Contains(definitions, resource.name) {
|
||||
if resource.definition() != "" && slices.Contains(definitions, resource.name) || resource.colorProfileUsed(spaces) {
|
||||
if err := write(resource.name, resource.data, false); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -581,7 +581,16 @@ func (x *ofdXML) resources(fonts, images []editorResource, spaces []ColorSpace)
|
||||
if x.err != nil {
|
||||
return
|
||||
}
|
||||
x.start("ColorSpace", ofdAttrs{{Name: xml.Name{Local: "ID"}, Value: space.ID}, {Name: xml.Name{Local: "Type"}, Value: space.Type}, {Name: xml.Name{Local: "BitsPerComponent"}, Value: strconv.Itoa(space.BitsPerComponent)}})
|
||||
attrs := ofdAttrs{{Name: xml.Name{Local: "ID"}, Value: space.ID}, {Name: xml.Name{Local: "Type"}, Value: space.Type}, {Name: xml.Name{Local: "BitsPerComponent"}, Value: strconv.Itoa(space.BitsPerComponent)}}
|
||||
attrs.add("Profile", space.Profile)
|
||||
x.start("ColorSpace", attrs)
|
||||
if len(space.Palette) != 0 {
|
||||
x.start("Palette", nil)
|
||||
for _, entry := range space.Palette {
|
||||
x.text("CV", entry)
|
||||
}
|
||||
x.end("Palette")
|
||||
}
|
||||
x.end("ColorSpace")
|
||||
}
|
||||
x.end("ColorSpaces")
|
||||
|
||||
Reference in new issue
Block a user