Skip to content

Commit

Permalink
Hardcode the overlay result to be a PNG instead of following the orig…
Browse files Browse the repository at this point in the history
…inal base image format
  • Loading branch information
baskarap committed Jan 19, 2020
1 parent 324fc22 commit f7ad58d
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/processor/native/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (bp *BildProcessor) Overlay(base []byte, overlays []*processor.OverlayAttrs
}
}

return bp.Encode(baseImg, f)
return bp.Encode(baseImg, processor.ExtensionPNG)
}

// WithEncoders is a builder function to set custom Encoders for BildProcessor
Expand Down
20 changes: 10 additions & 10 deletions pkg/processor/native/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func (s *BildProcessorSuite) TestBildProcessor_Overlay() {
overlays: []*processor.OverlayAttrs{},
},
{
expected: "./_testdata/overlay/overlay_1.jpg",
expected: "./_testdata/overlay/overlay_1.png",
overlays: []*processor.OverlayAttrs{
{
Img: overlay,
Expand All @@ -304,7 +304,7 @@ func (s *BildProcessorSuite) TestBildProcessor_Overlay() {
},
},
{
expected: "./_testdata/overlay/overlay_2.jpg",
expected: "./_testdata/overlay/overlay_2.png",
overlays: []*processor.OverlayAttrs{
{
Img: overlay,
Expand All @@ -315,7 +315,7 @@ func (s *BildProcessorSuite) TestBildProcessor_Overlay() {
},
},
{
expected: "./_testdata/overlay/overlay_3.jpg",
expected: "./_testdata/overlay/overlay_3.png",
overlays: []*processor.OverlayAttrs{
{
Img: overlay,
Expand All @@ -326,7 +326,7 @@ func (s *BildProcessorSuite) TestBildProcessor_Overlay() {
},
},
{
expected: "./_testdata/overlay/overlay_4.jpg",
expected: "./_testdata/overlay/overlay_4.png",
overlays: []*processor.OverlayAttrs{
{
Img: overlay,
Expand All @@ -337,7 +337,7 @@ func (s *BildProcessorSuite) TestBildProcessor_Overlay() {
},
},
{
expected: "./_testdata/overlay/overlay_5.jpg",
expected: "./_testdata/overlay/overlay_5.png",
overlays: []*processor.OverlayAttrs{
{
Img: overlay,
Expand All @@ -348,7 +348,7 @@ func (s *BildProcessorSuite) TestBildProcessor_Overlay() {
},
},
{
expected: "./_testdata/overlay/overlay_6.jpg",
expected: "./_testdata/overlay/overlay_6.png",
overlays: []*processor.OverlayAttrs{
{
Img: overlay,
Expand All @@ -359,7 +359,7 @@ func (s *BildProcessorSuite) TestBildProcessor_Overlay() {
},
},
{
expected: "./_testdata/overlay/overlay_7.jpg",
expected: "./_testdata/overlay/overlay_7.png",
overlays: []*processor.OverlayAttrs{
{
Img: overlay,
Expand All @@ -370,7 +370,7 @@ func (s *BildProcessorSuite) TestBildProcessor_Overlay() {
},
},
{
expected: "./_testdata/overlay/overlay_8.jpg",
expected: "./_testdata/overlay/overlay_8.png",
overlays: []*processor.OverlayAttrs{
{
Img: overlay,
Expand All @@ -381,7 +381,7 @@ func (s *BildProcessorSuite) TestBildProcessor_Overlay() {
},
},
{
expected: "./_testdata/overlay/overlay_9.jpg",
expected: "./_testdata/overlay/overlay_9.png",
overlays: []*processor.OverlayAttrs{
{
Img: overlay,
Expand All @@ -392,7 +392,7 @@ func (s *BildProcessorSuite) TestBildProcessor_Overlay() {
},
},
{
expected: "./_testdata/overlay/overlay_19.jpg",
expected: "./_testdata/overlay/overlay_19.png",
overlays: []*processor.OverlayAttrs{
{
Img: overlay,
Expand Down

0 comments on commit f7ad58d

Please sign in to comment.