Skip to content

Commit

Permalink
moved type definition readability
Browse files Browse the repository at this point in the history
  • Loading branch information
logica0419 committed Dec 11, 2023
1 parent 53cc3d9 commit 80ec7b5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions service/imaging/processor_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,6 @@ func (p *defaultProcessor) Fit(src io.ReadSeeker, width, height int) (image.Imag
return orig, nil
}

// GIFのリサイズ時、拡縮用GoRoutineに渡すフレームのデータ
type frameData struct {
index int
tempCanvas *image.NRGBA
resizeWidth int
resizeHeight int
srcBounds image.Rectangle
destBounds image.Rectangle
srcPalette color.Palette
}

func (p *defaultProcessor) FitAnimationGIF(src io.Reader, width, height int) (*bytes.Reader, error) {
srcImage, err := gif.DecodeAll(src)
if err != nil {
Expand Down Expand Up @@ -205,6 +194,17 @@ func (p *defaultProcessor) FitAnimationGIF(src io.Reader, width, height int) (*b
return imaging2.GifToBytesReader(destImage)
}

// GIFのリサイズ時、拡縮用GoRoutineに渡すフレームのデータ
type frameData struct {
index int
tempCanvas *image.NRGBA
resizeWidth int
resizeHeight int
srcBounds image.Rectangle
destBounds image.Rectangle
srcPalette color.Palette
}

func resizeRoutine(data frameData, destImage *gif.GIF, destImageMutex *sync.Mutex) func() error {
return func() error {
// 重ねたフレームを縮小
Expand Down

0 comments on commit 80ec7b5

Please sign in to comment.