Skip to content

Commit

Permalink
fix(document): fix bug about convert to image
Browse files Browse the repository at this point in the history
fix: fix image converter
  • Loading branch information
chuang8511 committed Nov 18, 2024
1 parent e846177 commit 718d070
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/component/operator/document/v0/convert_to_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/base64"

"github.com/instill-ai/pipeline-backend/pkg/component/base"
"github.com/instill-ai/pipeline-backend/pkg/component/internal/util"
"github.com/instill-ai/pipeline-backend/pkg/component/operator/document/v0/transformer"
"github.com/instill-ai/pipeline-backend/pkg/data"
"github.com/instill-ai/pipeline-backend/pkg/data/format"
Expand Down Expand Up @@ -36,7 +37,7 @@ func (e *execution) convertDocumentToImages(ctx context.Context, job *base.Job)
Images: func() []format.Image {
images := make([]format.Image, len(transformerOutputStruct.Images))
for i, image := range transformerOutputStruct.Images {
b, _ := base64.StdEncoding.DecodeString(image)
b, _ := base64.StdEncoding.DecodeString(util.TrimBase64Mime(image))
images[i], _ = data.NewImageFromBytes(b, data.PNG, "")
// TODO: handle error
}
Expand Down

0 comments on commit 718d070

Please sign in to comment.