Skip to content
This repository was archived by the owner on Sep 11, 2022. It is now read-only.

Panic on resize 2 #58

Closed
dblokhin opened this issue Mar 30, 2017 · 2 comments
Closed

Panic on resize 2 #58

dblokhin opened this issue Mar 30, 2017 · 2 comments

Comments

@dblokhin
Copy link

dblokhin commented Mar 30, 2017

Hi. This simple code generate a panic error:

package main

import (
	"github.com/nfnt/resize"
	"os"
	"image/jpeg"
)

func main() {
	f, err := os.Open("test.jpg")
	if err != nil {
		panic(err)
	}

	image, err := jpeg.Decode(f)
	if err != nil {
		panic(err)
	}

	resize.Resize(600, 0, image, resize.Lanczos3)
}

Message:

go run src/test.go 
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/nfnt/resize.imageYCbCrToYCC(0x18416140, 0x12)
        /dev/src/github.com/nfnt/resize/ycc.go:220 +0x5af
github.com/nfnt/resize.Resize(0x1f4, 0x0, 0x810bf00, 0x18416140, 0x5, 0x0, 0x184000f0)
        /dev/src/github.com/nfnt/resize/resize.go:173 +0x320a
main.main()
        /dev/src/test.go:20 +0xa0
exit status 2

The image is attached. It is a movie poster. The error appears with any InterpolationFunction. What can I do?
test

@dblokhin
Copy link
Author

dblokhin commented Apr 4, 2017

Is there anybody here?

@nfnt
Copy link
Owner

nfnt commented Feb 21, 2018

Duplicate of #37, fixed with #57.

@nfnt nfnt closed this as completed Feb 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants