Image resize

1,917 views
Skip to first unread message

Everson Alves da Silva

unread,
Sep 1, 2011, 8:10:50 AM9/1/11
to golan...@googlegroups.com
Hello guys,

Anyone one know a good library/class to resize images?

there's this one, but it looks not optimized and I need to deal with thousands of images at once:

I just need to open an image ( png or jpg) and save it to jpg in a new size (smaller).

Thanks.

unread,
Sep 1, 2011, 8:24:05 AM9/1/11
to golang-nuts
Maybe this will do:

man convert

http://www.imagemagick.org/script/convert.php

Everson Alves da Silva

unread,
Sep 1, 2011, 9:01:03 AM9/1/11
to golan...@googlegroups.com
Thank you. I was more interested in a go library for that. The tool should run on windows and mac and I wanted to avoid adicional steps, like installing image magick). The code I posted does work, but the quality of the resulting image is not that good.  If I don't a better one, I will use imageMagick.

Mathieu Lonjaret

unread,
Sep 1, 2011, 9:26:25 AM9/1/11
to golan...@googlegroups.com
Yeah, I kinda stalled on that, sorry.
a good starting point nowadays is what the moustachio guys did:
http://code.google.com/p/appengine-go/source/browse/example/moustachio/resize/resize.go

Mathieu Lonjaret

unread,
Sep 1, 2011, 9:31:37 AM9/1/11
to golan...@googlegroups.com
also, there are gd bindings: https://github.com/bolknote/go-gd

Nigel Tao

unread,
Sep 1, 2011, 6:48:01 PM9/1/11
to golan...@googlegroups.com
On 1 September 2011 23:26, Mathieu Lonjaret <mathieu....@gmail.com> wrote:
> Yeah, I kinda stalled on that, sorry.
> a good starting point nowadays is what the moustachio guys did:
> http://code.google.com/p/appengine-go/source/browse/example/moustachio/resize/resize.go

Note that that resize.go code is for release.r58.1, the same version
that Go App Engine runs. It should also work for the latest release:
release.r59.

The image package has changed since then. If you're running on weekly
or tip, you will need a different version of resize.go, which I have
attached.

Let me know if you have any problems.

resize.go
Reply all
Reply to author
Forward
0 new messages