GetDimensions grabs the width and height of an image in the cloud.
(f io.Reader)
| 61 | |
| 62 | // GetDimensions grabs the width and height of an image in the cloud. |
| 63 | func GetDimensions(f io.Reader) (int, int, error) { |
| 64 | img, _, err := image.Decode(f) |
| 65 | if err != nil { |
| 66 | return 0, 0, err |
| 67 | } |
| 68 | |
| 69 | bounds := img.Bounds() |
| 70 | return bounds.Max.X, bounds.Max.Y, nil |
| 71 | } |
| 72 | |
| 73 | // RemoveFileFromGCP removes a file from GCP. |
| 74 | func RemoveFileFromGCP(name string) error { |
no outgoing calls