nfnt / resize

Pure golang image resizing
ISC License
3.02k stars 321 forks source link

Add: thumbnail helper function #7

Closed matrixik closed 10 years ago

matrixik commented 10 years ago

Hi,

I added thumbnail helper function so that if someone simply want to create thumbnails he don't need to reinvent the wheel every time.

I have one question about behaviour:

Which approach do you prefer?

Best regards, Dobrosław Żybort

nfnt commented 10 years ago

Sorry for the waiting. I just merged your thumbnail function. Very helpful, thanks a lot!

matrixik commented 10 years ago

Thank you for accepting my code. But you did not say what approach you prefer. After some thinking I came to the conclusion that maybe Python PIL approach is better. Because if someone want thumbnail they most likely would also want them to be smaller (in file size) than original image and they are OK with lower quality and removed all meta-data. So maybe Thumbnail function should always process image with provided interpolation function.

Best regards, Dobrosław Żybort

nfnt commented 10 years ago

I'm sure both methods have their benefits and use cases. Let's stick with the one you provided.

matrixik commented 10 years ago

OK, but then maybe Thumbnail function should return second argument with information if image was processed or not: (image.Image, bool)?

nfnt commented 10 years ago

In my opinion the documentation should be enough.

matrixik commented 10 years ago

OK, thank you