Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread robert engels
I don’t know and I doubt anyone else does off the top of their head, so why 
don’t you write a test and see?

Image processing is highly image and usage dependent, e.g. acceptable quality 
vs. speed vs. memory.

Using non-quantifiable terms like “huge” is not testable nor verifiable.

> On May 10, 2020, at 9:50 PM, Vivi  wrote:
> 
> 
> How does it compare to vipsthumbnail that utilize low memory usage which I 
> believe it use horizontal threading, does Go's image/draw package consume 
> large memory if the image source is huge?
> 
> 
> On Monday, 11 May 2020 07:00:11 UTC+8, Nigel Tao wrote:
> On Mon, May 11, 2020 at 4:28 AM robert engels > 
> wrote: 
> > All of the code to do scaling and cropping in the ‘image’ package in the 
> > stdlib. 
> 
> Cropping is in the stdlib but scaling is not. Various scaling 
> algorithms (e.g. nearest neighbor, Catmull-Rom) are in the 
> golang.org/x/image/draw  package instead. As 
> https://godoc.org/golang.org/x/image/draw 
>  says, "This package is a 
> superset of and a drop-in replacement for the image/draw package in 
> the standard library". 
> 
> https://godoc.org/golang.org/x/image/draw#example-Draw 
>  has some example 
> code. 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/b0443e9a-3edb-4bcb-b056-f11186188eb9%40googlegroups.com
>  
> .

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4ECA0CE7-D503-4331-84CC-80EF1A85FB0B%40ix.netcom.com.


[go-nuts] Re: Why I fear Go

2020-05-10 Thread Vitaly Zdanevich
If you want to get some experience with Go - please reimplement Geeknote 
https://github.com/jeffkowalski/geeknote - currently written in Python 2.
Currently I have no time for that. I think that this is simple, 
interesting, useful project. And I will use it :)

On Saturday, May 9, 2020 at 8:57:23 PM UTC+3, shammah Zealsham Agwor wrote:
>
> I have been programming since 2016 but I have never really dived deep into 
> any language and haven't got a job with any . I decided to change all that 
> and focus with every soul in me on golang. But I have my fear as every go 
> job I have seen are looking for senior developers. And from what I noticed 
> in big corps and small ones alike ,people writing go there are senior who 
> wants to port existing large scale system to go . I'm afraid I'll never be 
> able to get an entry job with it and all my hard work will be a waste and 
> I'll have to put in such efforts again into another language . Should I 
> still go for it . I've been learning it for months now and I'm scared .

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/decb131c-853c-410d-8ac0-ac4c103a3dff%40googlegroups.com.


Re: [go-nuts] Re: How can stop a Read of net.Conn without closing it

2020-05-10 Thread hanisch


On Wednesday, June 5, 2019 at 10:14:22 AM UTC-4, Ian Lance Taylor wrote:
>
> On Wed, Jun 5, 2019 at 12:10 AM Kurtis Rader  > wrote: 
> > 
> > On Tue, Jun 4, 2019 at 11:53 PM Inada Naoki  > wrote: 
> >> 
> >> conn.SetReadDeadline(time.Now()) 
> > 
> > 
> > Did you test that solution? Setting a deadline only affects "future Read 
> calls" according to the documentation. It cannot be used to timeout an 
> extant read. Which is what I would expect given the available UNIX like 
> kernel APIs. So while I have not tested this using a program written in Go 
> I would not expect it to work and the equivalent solution definitely does 
> not work in other languages I use regularly. 
>
> No, this does in fact work in Go.  I should have thought of that.  The 
> docs say, correctly, "SetReadDeadline sets the deadline for future 
> Read calls and any currently-blocked Read call." 
>
> Ian 
>

Wouldn't something like conn.SetReadDeadline(time.Unix(1,0)) or 
SetReadDeadline(time.Unix(0,1)) be better than 
conn.SetReadDeadline(time.Now()), as it won't make an unnecessary system 
call to get the current time? I'm just trying to make sure I'm not missing 
something.

William

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e619b5d1-7c31-4a7c-9222-500a37ff189a%40googlegroups.com.


Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread robert engels
My bad, I didn’t read the API docs completely. Kind of a strange interface 
declaration in the stdlib image package - that there is only a single rectangle 
for Draw() and it is bounded by the two images.

> On May 10, 2020, at 5:57 PM, Nigel Tao  wrote:
> 
> On Mon, May 11, 2020 at 4:28 AM robert engels  wrote:
>> All of the code to do scaling and cropping in the ‘image’ package in the 
>> stdlib.
> 
> Cropping is in the stdlib but scaling is not. Various scaling
> algorithms (e.g. nearest neighbor, Catmull-Rom) are in the
> golang.org/x/image/draw package instead. As
> https://godoc.org/golang.org/x/image/draw says, "This package is a
> superset of and a drop-in replacement for the image/draw package in
> the standard library".
> 
> https://godoc.org/golang.org/x/image/draw#example-Draw has some example code.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/CAOeFMNXO6J87er5Gw_m782qjP5OHhoAnnvTyLpPBv6C%2B%2B16eHA%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/20997C39-CEA7-4395-877F-7A61C659C468%40ix.netcom.com.


Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread Nigel Tao
On Mon, May 11, 2020 at 4:28 AM robert engels  wrote:
> All of the code to do scaling and cropping in the ‘image’ package in the 
> stdlib.

Cropping is in the stdlib but scaling is not. Various scaling
algorithms (e.g. nearest neighbor, Catmull-Rom) are in the
golang.org/x/image/draw package instead. As
https://godoc.org/golang.org/x/image/draw says, "This package is a
superset of and a drop-in replacement for the image/draw package in
the standard library".

https://godoc.org/golang.org/x/image/draw#example-Draw has some example code.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOeFMNXO6J87er5Gw_m782qjP5OHhoAnnvTyLpPBv6C%2B%2B16eHA%40mail.gmail.com.


Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread robert engels
All of the code to do scaling and cropping in the ‘image’ package in the 
stdlib. You ‘draw’ into a new image to do scaling. You use SubImage() to 
perform cropping. See https://blog.golang.org/image-draw

Alternatively, if you need more advanced scaling operations it would be fairly 
trivial to port the GIMP scaling operations to Go.

> On May 10, 2020, at 1:12 PM, Michael Jones  wrote:
> 
> I have an extremely elaborate resizing library, but it is so complex it would 
> not make sense as a standard tool for common uses. (Many convolution kernels, 
> separate windows, forward and backward mapping, separable convolutions, 
> upsampling first for Nyquist issues, strategy phase and then concurrent 
> filtering, etc. good work but over the top) 
> 
> If nothing else, you could port Paul Heckbert’s filter program from days of 
> yore. Check graphics gems. 
> 
> On Sun, May 10, 2020 at 9:36 AM Vivi  > wrote:
> How do you advice to resize and crop JPEG and PNG or probably WebP images 
> without rely on 3rd parties dependencies?
> 
> It was hard to find a good snippet or could be useful to have basic API 
> function in Go standard library since it's a common feature.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/89e32097-6aa0-48a4-b2ca-8d3756e26af3%40googlegroups.com
>  
> .
> -- 
> Michael T. Jones
> michael.jo...@gmail.com 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/CALoEmQwOxRXsrB0%2B-oeAWB938A%2BOzCRppTQvrKENp9%3D8o3BcYQ%40mail.gmail.com
>  
> .

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0BA4F6D5-0E95-465F-B32C-4F9602787BE6%40ix.netcom.com.


Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread Michael Jones
I have an extremely elaborate resizing library, but it is so complex it
would not make sense as a standard tool for common uses. (Many convolution
kernels, separate windows, forward and backward mapping, separable
convolutions, upsampling first for Nyquist issues, strategy phase and then
concurrent filtering, etc. good work but over the top)

If nothing else, you could port Paul Heckbert’s filter program from days of
yore. Check graphics gems.

On Sun, May 10, 2020 at 9:36 AM Vivi  wrote:

> How do you advice to resize and crop JPEG and PNG or probably WebP images
> without rely on 3rd parties dependencies?
>
> It was hard to find a good snippet or could be useful to have basic API
> function in Go standard library since it's a common feature.
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/89e32097-6aa0-48a4-b2ca-8d3756e26af3%40googlegroups.com
> 
> .
>
-- 

*Michael T. jonesmichael.jo...@gmail.com *

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CALoEmQwOxRXsrB0%2B-oeAWB938A%2BOzCRppTQvrKENp9%3D8o3BcYQ%40mail.gmail.com.


[go-nuts] Image Resize and Crop

2020-05-10 Thread Vivi
How do you advice to resize and crop JPEG and PNG or probably WebP images 
without rely on 3rd parties dependencies?

It was hard to find a good snippet or could be useful to have basic API 
function in Go standard library since it's a common feature.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/89e32097-6aa0-48a4-b2ca-8d3756e26af3%40googlegroups.com.


Re: [go-nuts] Packages "Not found" at godoc.org

2020-05-10 Thread kushthedude
It is fixed now!

On Sunday, May 10, 2020 at 2:59:16 PM UTC+5:30, Jan Mercl wrote:
>
> On Sun, May 10, 2020 at 11:22 AM Sebastien Binet  > wrote: 
>
> > It seems like gitlab is going through some maintenance work (I get a 503 
> when trying to reach the files of the packages you labeled as working). 
> > Perhaps it's just that (and some caching effect)? 
>
> Ah, you're right, now I'm getting a 503 from gitlab.com as well. When 
> I tried the same before OP it still worked. 
>
> Thanks! 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/022a104c-569b-4269-b682-9b31c47945ba%40googlegroups.com.


[go-nuts] ?import-graph on pkg.go.dev?

2020-05-10 Thread fgergo
Hi,
 is there a plan to be able to use ?import-graph on pkg.go.dev similar
to godoc.org in the future?
(Sorry if I missed any announcement about this.)
thanks,
Gergely Fodemesi

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bctqrqg%3D-eoF1jnd6yP85S-reh7oaCNM%3DpPCE3LOYvyU4D5Gg%40mail.gmail.com.


Re: [go-nuts] Packages "Not found" at godoc.org

2020-05-10 Thread Jan Mercl
On Sun, May 10, 2020 at 11:22 AM Sebastien Binet  wrote:

> It seems like gitlab is going through some maintenance work (I get a 503 when 
> trying to reach the files of the packages you labeled as working).
> Perhaps it's just that (and some caching effect)?

Ah, you're right, now I'm getting a 503 from gitlab.com as well. When
I tried the same before OP it still worked.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-VY%3DKSKfxRff7cvhVA8-9A3rRKJWMS1wHv6vvggerAQCg%40mail.gmail.com.


Re: [go-nuts] Packages "Not found" at godoc.org

2020-05-10 Thread Sebastien Binet
It seems like gitlab is going through some maintenance work (I get a 503
when trying to reach the files of the packages you labeled as working).
Perhaps it's just that (and some caching effect)?

sent from my droid

On Sun, May 10, 2020, 11:11 Jan Mercl <0xj...@gmail.com> wrote:

> It came to my attention that some of my packages are not accessible at
> godoc.org at the time of this writing (09:05 UTC).
>
> A sample of URLs that report "Not Found":
>
> https://godoc.org/modernc.org/strutil
> https://godoc.org/modernc.org/mathutil
> https://godoc.org/modernc.org/cc
> https://godoc.org/modernc.org/b
> https://godoc.org/modernc.org/gocc
> https://godoc.org/modernc.org/qbe
>
> It seems the problem is not in the redirector as at least some other
> packages/commands work as usual, for example:
>
> https://godoc.org/modernc.org/golex
> https://godoc.org/modernc.org/ql
> https://godoc.org/modernc.org/kv
> https://godoc.org/modernc.org/sqlite
>
> Has anyone a similar experience and/or some insight into the problem?
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAA40n-UM4%2BGu4ZeP_9_S2r_Rb8DWcp1X2aWUzv-hXV3DeD3u7A%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAAV3P_B8Es-ZqANEAUhENttCmXoj9FYy3b0gNHE7TTQULdXbXg%40mail.gmail.com.


[go-nuts] Packages "Not found" at godoc.org

2020-05-10 Thread Jan Mercl
It came to my attention that some of my packages are not accessible at
godoc.org at the time of this writing (09:05 UTC).

A sample of URLs that report "Not Found":

https://godoc.org/modernc.org/strutil
https://godoc.org/modernc.org/mathutil
https://godoc.org/modernc.org/cc
https://godoc.org/modernc.org/b
https://godoc.org/modernc.org/gocc
https://godoc.org/modernc.org/qbe

It seems the problem is not in the redirector as at least some other
packages/commands work as usual, for example:

https://godoc.org/modernc.org/golex
https://godoc.org/modernc.org/ql
https://godoc.org/modernc.org/kv
https://godoc.org/modernc.org/sqlite

Has anyone a similar experience and/or some insight into the problem?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-UM4%2BGu4ZeP_9_S2r_Rb8DWcp1X2aWUzv-hXV3DeD3u7A%40mail.gmail.com.