test: ffmpeg processor tests
This commit is contained in:
parent
bb48a1e717
commit
d9c697a0b2
13 changed files with 165 additions and 15 deletions
12
processor.go
12
processor.go
|
|
@ -57,9 +57,6 @@ func (p *Processor) Process(ctx context.Context, in *imagor.Blob, params imagorp
|
|||
if err == nil || out != nil {
|
||||
return
|
||||
}
|
||||
if _, ok := err.(imagor.ErrForward); ok {
|
||||
return
|
||||
}
|
||||
// fallback image on error
|
||||
out = imagor.NewBlobFromBytes(transPixel)
|
||||
if p.FallbackImage != "" {
|
||||
|
|
@ -85,8 +82,15 @@ func (p *Processor) Process(ctx context.Context, in *imagor.Blob, params imagorp
|
|||
if reader, size, err = in.NewReader(); err != nil {
|
||||
return
|
||||
}
|
||||
if size <= 0 {
|
||||
// force read full file if size unknown
|
||||
_ = reader.Close()
|
||||
reader = nil
|
||||
}
|
||||
default:
|
||||
if reader, size, err = in.NewReadSeeker(); err != nil {
|
||||
}
|
||||
if reader == nil {
|
||||
if reader, size, err = in.NewReadSeeker(); err != nil || size <= 0 {
|
||||
// write to temp file if read seeker not available
|
||||
if reader, _, err = in.NewReader(); err != nil {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue