Skip to content

Commit

Permalink
refactor for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
logica0419 committed Dec 14, 2023
1 parent 5e05fe4 commit 4c894e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/imaging/processor_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ func (p *defaultProcessor) FitAnimationGIF(src io.Reader, width, height int) (*b
switch srcImage.Disposal[i] {
case gif.DisposalBackground: // DisposalがBackgroundなら、このフレームの範囲を背景色で塗りつぶす
// フレームのカラーパレットに透明色が含まれていたら、背景色を透明色とみなす
if r, g, b, a := srcFrame.Palette[srcFrame.Palette.Index(color.Transparent)].RGBA(); r == 0 && g == 0 && b == 0 && a == 0 {
r, g, b, a := srcFrame.Palette[srcFrame.Palette.Index(color.Transparent)].RGBA()
if r == 0 && g == 0 && b == 0 && a == 0 {
draw.Draw(tempCanvas, srcBounds, image.Transparent, image.Point{}, draw.Src)
} else {
draw.Draw(tempCanvas, srcBounds, bgColorUniform, image.Point{}, draw.Src)
Expand Down

0 comments on commit 4c894e8

Please sign in to comment.